We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


Debug RPG Program

Medium Priority
Last Modified: 2013-12-12

Hello All,
I am having a Physical file(Flat File with one field of record Length 1700)  which is having 5000 record ftped from the client every 30 minutes , there is a batch job (RPG Program) which then loads the file in to our application system basically every 30 minutes.

OK the problem is I am getting Decimal data Error in the RPG PGM,
Question is:
1.When I take RPG Dump How can I read this Dump?
2.When I debug this PGM using STRDBG  How can I get to the Exact record  which is having this error.
3.CL PGM is calling this RPG PGM, so which on I have to Debug
4.What it Production Update(*yes) Mean?
5.Any useful Debugging Tips will be Help full.

Watch Question

Gary PattersonVP Technology / Senior Consultant

1. Post the dump and we can explain it to you.  Easiest way is to use Navigator to save the spooled file as a text file and post the text file here.  Alternately, you can create a physical file to hold the spooled file (CRTPF), copy the spooled file to your new database file (CPYSPLF), and then do an FTP the resulting file down to your PC (do an ASCII transfer), but that is a bit more work.

You are looking for a numeric field that contains invalid numeric data.  Odds are, the flat file gets parsed somehow into specific fields (moved into a data structure, substringed out, etc.), and the error is going to occur when non-numeric data is moved into a numeric field.  Inspect each numeric field int he dump to see which one contains invalid data.  A common error is to move blanks (x'40') into a numeric field.

2. Just STRDBG and run the program.  It will automatically break when it encounters the error, and you can then display variables, etc, and figure out what record was last read.  If the program doesn't block records, you can do a DSPJOB (Sysreq-3), option14, and see what record was last read.  f the program does block records, you will need to inspect the dump or look at the contents of your one big field (EVAL BIGFILEDNAME) to determine which record is being processed.

3. Debug whichever program is the failing program.  It is probably the RPG.

4. It is a safety feature of debug.  *YES means that it is OK for production files (*PROD) to be updated while you are debugging.  *NO means that updates to production files should be blocked.

5. If you want to do source debugging, your program needs to be compiled with some debugging view (source view is best if source code and object code exist on the system where you will be debugging, otherwise use LIST view to embed a compile listing inside the program object.  LIST view results in a larger program object).  It is always best to debug in your test environemnet if possible.

- Gary Patterson

just a footnote:

Production update refers to a property of the library where the data is located. Each library can be defined as either *PROD or *TEST.

You can see the current property with commands DSPLIBD or CHGLIB.



Pls find attached RPG DUMP
VP Technology / Senior Consultant
Unlock this solution and get a sample of our free trial.
(No credit card required)


***** (5 Star) , Thank you Gary ( I dont think Just Thank you is enough for your Answer , But any way THANKYOU)
Gary PattersonVP Technology / Senior Consultant

Happy to help.

- Gary Patterson
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.