85 pts.
 Getting job log info into RPGLE program
I'm looking for an easy way to get "error" information from the job log into my RPGLE Program. I'm "monitoring" a CHAIN to a file for an "unable to allocate" error, and would like to pop-up a window to display who is locking the record. How do I go about doing this? Thanks

Software/Hardware used:
ASKED: January 5, 2007  10:49 AM
UPDATED: January 5, 2007  12:45 PM

Answer Wiki:
You can make use of the program status data structue (PSDS) and the %Error built in function. Positions 91-170 contains an 80 character message for the exception detected and will contain the details of the job causing any record log. For example: FMYFILE IF E K Disk InfDs(MyFileDs) D* Program Status Data Structure D PgmSts SDS D sdsRtvExcpDta 91 170 C* Chain to the file and check for any errors... C MyKey Chain(e) MyFile C If %Error C CallP FileError(sdsRtvExcpDta) C Else C ...Normal Processing C EndIf By coding the (e) extension on the Chain you are able to trap the error. In the example I would then place a call to a sub-procedure "FileError" which would display the exception message in a window. Hope it helps Jonathan
Last Wiki Answer Submitted:  January 5, 2007  12:02 pm  by  astradyne   370 pts.
All Answer Wiki Contributors:  astradyne   370 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Thanks Astradyne…

I had been using the PDS, with the same 91 to 170 location.
The problem was I was using a monitor, and an On-Error 01218, which pulled in just the “Unable to allocate record.” message rather than the “Record 1781 in use by job 079142/BSCHMI/BSCHMI1.’
Don’t know why it is different, but that solved the problem.

 85 pts.