Relay problem or something else

1998 dodge truck runs after key is turned off replaced ignition sw same result

Diesel or gasoline? How have you been getting it to turn off?

If you replaced the part the key goes into, and that didn’t work, you now need to check the other part (the actual SWITCH part). Of course, it’s possible that wiring is at fault. I won’t say anything about checking the RUN circuit using a wiring diagram and an electrical multimeter.

gasoline eng, i didnt do any thing a “gremlin” shut it off, however there has been a slow drain on the battery that is still an issue

perhaps that is all or part of the problem,it would be helpful if i knew the sequence of events when the igtion key is turned on and off

Are you talking about “dieseling” or does it continue to run as if the key was not turned off?

runs like the key is in the run position

If you want a SWAG, see if your ASD (auto shut down) relay is the same as another one in the PDC (power distribution center) under the hood. If so, swap it and see if the condition evaporates with the engine running, but appears somewhere else.