You can find an explanation as well as code samples on how to approach that challenge here:
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of James H. H. Lampert
Sent: 22. februar 2014 02:00
Subject: Now another question on retrieving messages other than requests
Here's the scenario:
I'm calling Scott Klement's JDBCR4 service program (actually, my own expanded version thereof, but...). I try to connect to a system that rejects the connection. A procedure in the service program puts a diagnostic message in the joblog, a CPF9897 with the text (at least in the version of the scenario I can readily reproduce) "The application server rejected the connection. (General security error.)"
I want to be able to retrieve and display this diagnostic from the program (ILE RPG, FWIW, but this is presumably a system API question, not an RPG question) that called JDBCR4.
If F9 the message, I get (and JDBCR4QV is my expanded JDBCR4):
From program . . . . . . . . . : JDBCR4QV
From library . . . . . . . . : AQUESTVIEW
From module . . . . . . . . : JDBCR4
From procedure . . . . . . . : JNI_CHECKERROR
From statement . . . . . . . : 7209
To program . . . . . . . . . . : JDBCR4QV
To library . . . . . . . . . : AQUESTVIEW
To module . . . . . . . . . : JDBCR4
To procedure . . . . . . . . : JNI_CHECKERROR
To statement . . . . . . . . : 7209
I can see the message by doing a DSPJOBLOG, but I can't figure out how to make the calling program see it. Can I do so without further modifications to my expanded JDBCR4?
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l
This communication is intended only for use by the addressee.It may contain confidential or privilegedinformation.
If you receive this communication unintentionally, please inform us immediately and delete this e-mail and any attachments.
Warning: Although we have taken reasonable precautions to ensure no viruses are present in this email, we cannot accept
responsibility for any loss or damage arising from the use of this email or attachments.