![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/b/17/b175aa40-2073-490d-99cc-71e55a67baee/b175aa40-2073-490d-99cc-71e55a67baee-bg35.png)
Chapter 3. Common Information across APIs—Basic (OPM)
Example
Through the use of several examples, this chapter provides information about how
to use original program model (OPM) APIs in your programs. The primary example
programs in this chapter are also shown in additional languages in “Original
Program Model (OPM) APIs—Examples” on page B-2.
In the examples, the following are focus items:
Description of an API by section
Fixed-length formats
Variable-length fields as output
Optional parameters
The Retrieve Job Description Information (QWDRJOBD) API is used as the founda-
tion for the examples in this chapter. The QWDRJOBD API has been included in
“Retrieve Job Description Information API—Example” on page 3-29 for your use, if
you would like to refer to it as you read this chapter.
For details on the OS/400 APIs, refer to the
System API Reference
, SC41-5801.
Original Program Model (OPM) API–Scenario
In this chapter, accessing information from a job description is used to demonstrate
how to code APIs. While this may not be what your application requires, you can
use the same approach to access information when you use most of the APIs.
Assume that you are interested in accessing the value of the hold parameter on the
Retrieve Job Description (RTVJOBD) command. The hold parameter determines
whether the job is held on the job queue. Two values are supported:
*NO The job is not held.
*YES The job is held on the job queue.
Finding the API Name to Use
A first step in finding the correct API is to identify the part of the OS/400 program
that is most closely related to the function in which you are interested.
If you want to access information from a job description, for example, you have to
know that a job description object is considered part of the work management func-
tion. Next, you would turn to that chapter of the
System API Reference
.
Within each chapter of the
System API Reference
, the APIs are listed in alphabet-
ical order by the spelled-out form of the API name. The API names contain verbs
that are similar to the OS/400 licensed program: change, create, remove, and
retrieve. Other verbs, such as list and set, you may not be familiar with. For more
information on verbs, see Figure 2-1 on page 2-2. If you want to access informa-
tion from a job description, the verb retrieve is a good place to start.
Retrieve functions are available for several work management objects, such as data
areas, job descriptions, and job queues. Retrieve functions are also available for
Copyright IBM Corp. 1997 3-1