IBM Version 4 Universal Remote User Manual


 
C
Cᑍ Beginning of Mainline
C
Cᑍ Two parameters are being passed into this program.
C
C ᑍENTRY PLIST Parm list
C PARM JOBD 1 Job descrp
C PARM JOBDL 1 Jobd library
C
Cᑍ Move the two parameters passed into LFNAM.
C
C JOBD CAT JOBDL LFNAM 2 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 include.
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 value
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 is returned for
error conditions.
Retrieve job description data structure
This defines format JOBD0100, a 390-byte data structure with the hold field in
positions 77-86.
Dummy data structure
This contains a field used for the length of the receiver variable. The field is
defined as binary and is in the first 4 bytes. The dummy data structure (19
on page 3-17) also contains the format field.
This data structure is used because RPG only allows binary variables to be
defined in the context of a data structure.
The program retrieves the parameter list that is passed and initializes the fields to
be passed to the API. The API is called and places information into the receiver-
3-18 System API Programming V4R1