Link to home
Start Free TrialLog in
Avatar of Oramcle
Oramcle

asked on

Debug RPG Program


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.

Thanks
Oramcle
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

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.

ShalomC
Avatar of Oramcle
Oramcle

ASKER

Pls find attached RPG DUMP
splf.txt
ASKER CERTIFIED SOLUTION
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Oramcle

ASKER

***** (5 Star) , Thank you Gary ( I dont think Just Thank you is enough for your Answer , But any way THANKYOU)
Happy to help.

- Gary Patterson