Did you try the procedure in this thread?
How to get your Mil Code from your Dodge Ram If that doesn't work for your 5.9L then I'd just drop into a place like Auto Zone, Pep boys, etc and they will check for codes for free. As for troubleshooting a surging problem it could be anything from bad fuel to a dirty MAF or Oxygen sensor to a dirty air filter, etc and is just a process of elimination.