IBM Version 4 Universal Remote User Manual


 
5 NBR-OF-SELECT-CRITERIA PIC S9(9) VALUE  BINARY.
5 CONTINUATION-HDL PIC X(16).
5 BASE-POINTER POINTER.
5 INFO-POINTER POINTER.
5 SPACE-NAME PIC X(2) VALUE "RCVVAR QTEMP ".
5 SPACE-ATTR PIC X(1).
5 SPACE-SIZE PIC S9(9) VALUE 35 BINARY.
5 SPACE-VALUE PIC X(1) VALUE X"".
5 SPACE-AUTH PIC X(1) VALUE "ᑍUSE".
5 SPACE-TEXT PIC X(5).
5 SPACE-REPLACE PIC X(1) VALUE "ᑍNO".
5 SPACE-DOMAIN PIC X(1) VALUE "ᑍUSER".
LINKAGE SECTION.
ᑍ Variable to hold results of QusRetrieveExitInformation. The
ᑍ storage for this variable will be allocated by way of a User
ᑍ Space.
1 RCVVAR PIC X(35).
ᑍ Registration Facility API include. These includes will be
ᑍ mapped over the RCVVAR (User Space) previously defined.
COPY QUSREG OF QSYSINC-QLBLSRC.
ᑍ Beginning of mainline
PROCEDURE DIVISION.
MAIN-LINE.
ᑍ Retrieve the exit point information first. If the current
ᑍ number of exit programs is not zero, retrieve the exit
ᑍ programs. It is not necessary to call for the exit point
ᑍ information to determine if the exit point has any exit
ᑍ programs. It is done here for illustrative purposes only.
ᑍ You can make one call to the API for the exit program
ᑍ information and check the number of exit program entries
ᑍ returned field to see if there are any exit programs to call.
ᑍ Initialize the error code to inform the API that all
ᑍ exceptions should be returned through the error code parameter.
MOVE 16 TO BYTES-PROVIDED OF QUS-EC.
ᑍ Create a User Space for RCVVAR.
CALL "QUSCRTUS" USING SPACE-NAME, SPACE-ATTR, SPACE-SIZE,
SPACE-VALUE, SPACE-AUTH, SPACE-TEXT,
SPACE-REPLACE, QUS-EC, SPACE-DOMAIN.
ᑍ If an exception occurs, the API returns the exception in the
ᑍ error code parameter. The bytes available field is set to
ᑍ zero if no exception occurs and greater than zero if an
ᑍ exception does occur.
IF BYTES-AVAILABLE OF QUS-EC > 
IF EXCEPTION-ID OF QUS-EC = "CPF987"
B-68 System API Programming V4R1