1965 904 Trans cable question
Both can be removed without pulling the pan. It's just a matter of tripping the clip that holds the end of the cable. The rear one is fairly easy because the access is better. Start by pulling the allen head plug in the small aluminum housing that covers the parking pawl. Let the fluid drain out a bit then release the cable clamp nut/stud. Back the nut out until flush with the end of the stud. Then tap that end so the stud moves to the side and releases the cable housing. Pull the cable out as far as it will go and then with a small flat blade screw driver, poke around inside until you feel the spring clip that holds the end. Gently pry it to the side and the cable will release and come out. If you just can't seem to figure it out, pull the little cover off and you can see how it works. Once you get that one out you can see how it's held in so it makes it easier to figure how to do the shift cable which is the same idea but just worse access. I try to keep from turning the adjustment wheel so you don't have to readjust when you reinstall it.
Tie a rag around your wrist and have fun!
Mark