IBM Version 4 manual Initial, Information across APIs-Basic OPM 3-Example

Models: Version 4

1 505
Download 505 pages 30.92 Kb
Page 71
Image 71

variable data structure if information is found. The API places the error-code data structure if an error occurred and if enough spac receive the information.

The program prints one of two different lines depending on whether a found:

HOLD value - \NO .17/

Failed. Error ID - CPF98ð1 .18/

Accessing a Field Value

(Initial

Library

List)—OPM RPG

Example

In this topic,

the

JOBDAPI program accesses a variable-length array.

length

array is

the

initial library

list for the job description.

The discussion of the initial library list field in the job descrip Format” on page 3-30, indicates that the initial library list field is where each entry is a library name followed by a blank. Because t number of libraries allowed on an initial library list is 25, this fi including 275 bytes in length. Depending on how many libraries are name initial library list, the actual amount of space used varies (by mul

The format does not have an entryOffsetcolumnsinthefor initial library list. It begin in offset 390, but you should not rely on this. For example, i added to the job description format, it will probably be placed a initial library list information will be shifted.

To access the initial library list field, use the following two field

Ÿ Offset to the initial library.19/ on listpagefield3-22 (and on page 3-31).

ŸNumber of libraries in the initial .2ð/libraryon pagelist 3field-22 and( on page 3-31).

If

you

use

these field values in the format instead

of

hard

cod

number of libraries, your program can work

on any future release of

business

computing

system,

even

if more

job

description

attributes

ar

the

format. This is an important upward compatibility approach that yo

use

whenever

you

code

for

a

list of

entries.

 

 

 

 

The following

RPG code sends a message

for

each library

found

in

th

list

field. Exceptions are handled by the

RPG program. Although a libr

cannot exceed 10 bytes, each entry is 11 bytes long.

 

 

 

I\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

 

 

 

 

I\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

 

 

 

 

I\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I\Program Name: JOBDAPI

 

 

 

 

 

 

 

 

 

 

 

I\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I\Language: OPM RPG

 

 

 

 

 

 

 

 

 

 

 

I\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I\Descriptive Name: Get Job Description

 

 

 

 

 

 

 

 

I\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I\Description: This sample program shows the correct

 

 

 

 

 

 

I\

 

 

way of using the offset in a user space in RPG.

 

 

 

 

 

I\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I\Header Files Included: QUSEC - Error Code Parameter

 

 

 

 

 

 

I\

 

 

 

 

(Copied into Program)

 

 

 

 

 

 

I\

 

 

 

QWDRJOBD - Retrieve Job Description API

 

 

 

 

I\

 

 

 

 

 

(Copied into Program)

 

 

 

 

 

 

I\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

 

 

 

 

 

 

 

Chapter

3.

Common

Information across

APIs—Basic (OPM) 3-Example19

 

 

Page 71
Image 71
IBM Version 4 manual Initial, Information across APIs-Basic OPM 3-Example