My gear shift moves but wont go into gear. its automatic trans. on 1998 Mercury Grand Marquis

I started my car and went to put it into gear and the gear shift moves but it isnt catching and going into gear. It just slides up and down. Its an automatic transmission. How to I fix this problem?

Sounds like a broke shit cable
1 more answer , 1 more comment
You need a helper or even two... 1.) With someone slowly but naturally moving the gear shift handle/lever through its limits and shouting each gear the lever is passing through; you need to be observing the linkage actions (or lack thereof) under the hood and on down to the transmission. It could be as simple as cotter pin fell out or broke off that ties the linkage together along its path, or facsimile. 2.) If the linkage is following the helpers gear lever actions all the way down to the transmission box, then it is probably the 'Modulator' (a relatively inexpensive part). - I assume that you have checked the fluid level accordingly (hot and in neutral on level ground; as it is possible that the filter (inside pan) is clogged (should have experienced losing Reverse gear now and then as a symptom also, but not always). If you are unsure of your linkage movement's normal actions, try to look at a similiar vehicle's operation as a guide. Good Luck.
Would this be the same for a 1997, and is replacing the cable/rod hard to do?