Info for replacing a shift cable housing I have a Raleigh MT 200 - 1994. I lost the segment of the housing for the cable of the rear derailleur (Shimano STX) that goes to the shifter, see red in the image 1.

I would likely purchase a replacement online. I want to know what should I look for in the spec, to make sure that I am buying the right thing.

What I found in the segment that goes to the derailleur (which is similar to the segment that goes to the front shifter):


Legend in the housing: Shimano SIS SP, image 4.
Outer diameter: 5mm, measured with caliper.
Two different metallic ferrules in the ends, images 2-4. The grooved ferrule goes to the shifter. These look very much like types A and B in https://www.bikeman.com/bicycle-repair-tech-info/bikeman-tech-info/1641-cables-a-housing
Length: about 200mm.


So, I have several specific questions:


Is there anything else I should look for?
Will an SP40 work (like http://www.ebay.com/itm/Shimano-XTR-XT-SLX-Shifter-Cable-Housing-SIS-SP40-/301329907340)?
Or an SP41?
Is it mandatory that the two ferrules are different, of types A and B respectively? (I do not know the difference among them).
What does "sealed" mean (like in http://www.ebay.com/itm/SHIMANO-180mm-SIS-SP-Sealed-Cable-Housing-New-w-black-ferrules/222309191697)
I would suggest replacing the inner as well as all the outers. If the inner is frayed at all, you will not be able to rethread it. The benefits of a new cable are much better shifting, to the point cables are considered a consumable by many riders - just like tires and brake pads.  

Shifter cables are very generic and cheap - as low as $5 online for a set.

You will also need a cable cutter. Dedicated bicycles ones make the job fast and tidy. You can use heavy duty wire cutters, but needs more care and is less successful get tidy and fray free cuts. If you don't have access to a decent cutter, you could buy one for about $25. If you plan this to be a once only, the LBS will install a new cable cheaper than buying the tool.