from a base of 0, but not all languages can use this base. CL and RPG, for
example, work from a base of 1, so you need to add 1 to the decimal value of each
offset. The hold on job queue field begins at decimal offset 76, for example. To
access the information in CL or RPG, you need to address byte 77 within the
receiver variable.
Using the format, you can tell that the field after the hold on job queue field, output
queue name, begins in offset 86. This means that the hold on job queue informa-
tion is in the following location from a CL or RPG perspective:
7786
..
..
XXXXXXXXXX
The only possible values for the hold on job queue field are *YES and *NO. They
are left-justified in the field and the remaining positions are blank.
Most of the formats provide additional bytes for each field to allow for expansion,
such as a new value for the hold on job queue field that would be more than 4
bytes.
Many of the needed structures are provided by the system-include library,
QSYSINC. However, any fields of a structure that are variable in length are not
defined by QSYSINC. These variable-length fields must be defined by the user, as
shown by .7/ on page 3-20. For more information on the QSYSINC library, see
“APIs and the QSYSINC Library” on page 2-28.
Retrieving the Hold Parameter (Exception Message)—OPM RPG
Example In the following program example, all the pieces have been put together with an
RPG program that accesses the hold on job queue information from a job
description. A message is sent for the value found. To make the RPG program
more general purpose, two parameters for the job description (JOBD) name and
library (JOBDL) name are passed to it .8/ (refer to page 3-7). The program
example, which is named JOBDAPI (this program name is also used in other exam-
ples in this chapter), does not handle errors. Any errors that are received are
returned as exception messages.
I\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
I\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
I\
I\Program Name: JOBDAPI
I\
I\Language: OPM RPG
I\
I\Descriptive Name: Job Description
I\
I\Description: This example expects errors to be sent as escape
I\ messages.
I\
I\Header Files Included: QUSEC - Error Code Parameter
I\ QWDRJOBD - Retrieve Job Description API
I\
I\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
I\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
I\
I\ Error Code Parameter Include for the APIs
I\
I/COPY QSYSINC/QRPGSRC,QUSEC
3-6 System API Programming V4R1