Question i have a panasonic tv with no optical output and a sony sound bar with optical input.

If your TV doesn't have an optical audio output it may not support ARC either. If there is no HDMI jack labeled ARC it doesn't. There would only be one.
If the TV has an analog audio or headphone output you can get an analog to digital converter. Or get a soundbar with an aux input.