Consider this.......
Before you replace anything check the harness and pin connectors at the pcm. If it is the type that is installed above the front footwell then someone sitting there may have pulled on the harness by stretching out their legs resulting in pins being pulled from the sockets to the pcm even though the sockets are plugged in pcm. Been there done that, so, look carefully at this area first..............
99 GMC SUB, 2500, 4x4, 6.5 TD (F) #H32 enhanced blk, Phaser timing set, B&D IC, 3" ATS exh, K&N w/prefilter, 4WD NVG 246, 4L80E kevlar Transgo off road/tow mods/B&M supercooler, 14 FF MagTec w/locker 3.42:1, 9.25" IFS frt/diff 3.42:1 w/ARB locker, AutoMeter Boost & pre-turbo pyro meter, 12,000 lb hydro winch, Warn classic bumper w/brushguard & diesel scoop, Max E-torq Stage 3, hi pop inj, oil bypass sys, on board air comp for front ARB locker & tire inflation, DynaView driving/auto-cornering lts, DZ nerfs, A/T 285/75/16 SilentArmor 3750 lb rated on 3750 lb rated Alcoa, 3 IP drivers 2 r spares.