If you are trying to relearn throttle trim, disconnecting the battery will do the trick.
On the 97-03 MY, when you hooked it back up, you needed to start the truck, let it idle for ~ 2 min, then take it for 2 drive cycles. The truck needs at least 1/2 tank of fuel in it.
The drive cycle is driving it as you normally will ( i.e. if you are heavy on the throttle off the line, drive it that way, no need to beat on it ), pull away, and you need to sustain over 46 mph at least 2 times in the drive cycle, then back down, stop, and repeat. So it is a case of city ( with stop ), freeway, city ( with stop ) and freeway.
Not sure what you are trying to do with a PCM and crankshaft sensor relearn. What is the problem you are trying to cure ?
BTW : the crankshaft sensor does not perform any learning, it either works or doesn't.