Getting job log info into RPGLE program

85 pts.
Tags:
CLP
RPGLE
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
ASKED: January 5, 2007  10:49 AM
UPDATED: January 5, 2007  12:45 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • MMAGuy
    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 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following