1999 dodge ram 2500 5.9 360

Check the wires and connector to the sensor? Also check the body grounds are intact and not full of green fuzzy crap.

I found a couple of grounds that needed some attention and also the alternator , ground was starting to corrode ill take the truck for a ride in a couple of hours and will report back latrr
Thanks Aaron