exception. You cannot receive a diagnostic message (if one were sent in addition
to the escape message) in the error-code data structure. You can use the message
handling APIs to receive messages from your program message queue and to
access the other messages that may be issued from the API. Appendix A of the
System API Reference
book contains an example of a diagnostic report program
that uses the message handling APIs.
When you instruct the API to return all errors in the error-code data structure, the
escape message does not appear in the job log. The escape message not
appearing in the job log is one of the major differences between letting the API
return errors in an error-code data structure and letting the API send escape mes-
sages. For the error-code data structure, the escape messages have been
removed from the job log by the API. If a diagnostic message is sent first, the
diagnostic message exists in the job log and can be received.
Accessing the HOLD Attribute—OPM RPG Example
The following is the RPG code used to access the HOLD attribute. This is the
same type of program as the RPG program examples in “Retrieving the Hold
Parameter (Exception Message)—OPM RPG Example” on page 3-6 and
“Retrieving the Hold Parameter (Error Code Structure)—OPM RPG Example” on
page 3-11. The program, named JOBDAPI, prints the value of HOLD if it is found
(17 on page 3-19). If an error occurs, the program prints a line that contains the
error message ID to a spooled file called QPRINT (18 on page 3-19).
Fᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
Fᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
Fᑍ
FᑍProgram Name: JOBDAPI
Fᑍ
FᑍLanguage: OPM RPG
Fᑍ
FᑍDescriptive Name: Get Job Description
Fᑍ
FᑍDescription: The following program prints out the name of
Fᑍ the job description or prints an error if the
Fᑍ API could not find the job description name
Fᑍ specified.
Fᑍ
Fᑍ
FᑍHeader Files Included: QUSEC - Error Code Parameter
Fᑍ QWDRJOBD - Retrieve Job Description API
Fᑍ
Fᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
Fᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
Fᑍ JOBDAPIR - Print value of HOLD parameter using API
Fᑍ Uses error-code data structure
Fᑍ
FQPRINT O F 132 OF PRINTER
Iᑍ
Iᑍ Error Code Parameter Include for the APIs
Iᑍ
I/COPY QSYSINC/QRPGSRC,QUSEC
Iᑍ
Iᑍ Retrieve Job Description API Include
Iᑍ
I/COPY QSYSINC/QRPGSRC,QWDRJOBD
Iᑍ
Iᑍ
Iᑍ Dummy data structure used to declare binary field 19
Iᑍ
I DS
I I 39 B 1 4RCVLEN
I I 'JOBD1' 5 12FORMAT
Chapter 3. Common Information across APIs—Basic (OPM) Example
3-17