C\

 

 

 

 

 

 

C\ Beginning of Mainline

 

 

 

C\

 

 

 

 

 

 

C\ Two parameters are being passed into this program.

 

C\

 

 

 

 

 

 

C

 

\ENTRY

PLIST

 

 

Parm list

C

 

 

PARM

JOBD

Job descrp

C

 

 

PARM

JOBDL

Jobd library

C\

 

 

 

 

 

 

C\ Move the two parameters passed into LFNAM.

 

C\

 

 

 

 

 

 

C

 

JOBD

CAT JOBDL

LFNAM

Qlfd name

C\

 

 

 

 

 

 

C\ Error code parameter is set to 16.

 

 

 

C\

 

 

 

 

 

 

C

 

 

Z-ADD16

QUSBNB

 

Bytes provid

C\

 

 

 

 

 

 

C\ Instead of specifying 'QWCRJOBD', I could have used the

C\ constant QWDBGB that was defined in the QWDRJOBD includ￿e.

C\ Call the API

 

 

 

 

C\

 

 

 

 

 

 

C

 

 

CALL 'QWDRJOBD'

 

 

Parm list

C

 

 

PARM

QWDBH

 

Receiver Var.

C

 

 

PARM

RCVLEN

 

Length RCVVAR

C

 

 

PARM

FORMAT

 

Format Name

C

 

 

PARM

LFNAM

 

Qual. Job Desc

C

 

 

PARM

QUSBN

 

Error Code

C\ If no bytes available, API was successful; print HOLD val￿ue

C

 

QUSBNC

IFEQ ð

 

 

 

C

 

 

EXCPTGOOD

 

 

 

C

 

 

ENDIF

 

 

 

C\ If some bytes available, API failed; print error message￿ ID

C

 

QUSBNC

IFGT ð

 

 

 

C

 

 

EXCPTBAD

 

 

 

C

 

 

ENDIF

 

 

 

C\ End of program

 

 

 

 

C

 

 

SETON

 

LR

 

C

 

 

RETRN

 

 

 

C\

 

 

 

 

 

 

C\ End of MAINLINE

 

 

 

 

C\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

O\

 

 

 

 

 

 

OQPRINT

E

1ð6

GOOD

 

 

 

O

 

 

 

'HOLD value - '

 

O

 

 

QWDBHN

 

 

 

OQPRINT

E

1ð6

BAD

 

 

 

O

 

 

 

'Failed. Error ID - '

O

 

 

QUSBND

 

 

 

The following data structures are used:

Error-code data structure

This defines the two binary fields used and the message ID that error conditions.

Retrieve job description data structure

This defines format JOBD0100, a 390-byte data structure with the h positions 77-86.

Dummy data

structure

 

 

 

 

 

 

This

contains a field used

for

the

length

of the receiver

variabl

defined

as binary

and is

in the first 4

bytes. .The19/ dummy

data

on page

3-17) also

contains

the

format

field.

 

This data structure is used because RPG only allows binary variable defined in the context of a data structure.

The

program

retrieves the

parameter

list that is passed and initialize

be

passed

to the API.

The API is

called and places information into

3-18System API Programming V4R1

Page 70
Image 70
IBM Version 4 manual Following data structures are used, Error-code data structure, Retrieve job description data structure