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
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
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
ASKER
Pls find attached RPG DUMP
splf.txt
splf.txt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
- Gary Patterson
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