IBM Version 4 Universal Remote User Manual


 
1 NAME-OF-LIBRARY PIC X(1) VALUE "QUEUELIB".
1 SIZE-OF-MSG PIC S9(5) VALUE 1 PACKED-DECIMAL.
1 WAIT-TIME PIC S9(5) VALUE  PACKED-DECIMAL.
1 MSG PIC X(1) VALUE "EXAMPLE".
1 MSG-BACK PIC X(1).
ᑍ Beginning of mainline
PROCEDURE DIVISION.
MAIN-LINE.
ᑍ Initialize the error code parameter. To signal exceptions to
ᑍ this program by the API, you need to set the bytes provided
ᑍ field of the error code to zero. Because this program has
ᑍ exceptions sent back through the error code parameter, it sets
ᑍ the bytes provided field to the number of bytes it gives the
ᑍ API for the parameter.
MOVE 16 TO BYTES-PROVIDED.
ᑍ Initialize QCAPCMD options control block for CL processing
MOVE  TO COMMAND-PROCESS-TYPE.
MOVE "" TO DBCS-DATA-HANDLING.
MOVE "" TO PROMPTER-ACTION.
MOVE "" TO COMMAND-STRING-SYNTAX.
MOVE SPACES TO MESSAGE-KEY.
MOVE LOW-VALUES TO RESERVED OF QCA-PCMD-CPOP1.
ᑍ Create library QUEUELIB
CALL QCAPCMD USING CRTLIB, COMMAND-LENGTH, QCA-PCMD-CPOP1,
OPTIONS-SIZE, FORMAT-NAME, RECEIVER,
RECEIVER-LENGTH, RECEIVER-LENGTH, QUS-EC.
ᑍ 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 >  PERFORM ERROR-FOUND.
ᑍ Create a data queue called EXAMPLEQ in library QUEUELIB. The
ᑍ queue will have a maximum entry length set at 1, and will be
ᑍ FIFO (first-in first-out).
CALL QCAPCMD USING CRTDQ, COMMAND-LENGTH, QCA-PCMD-CPOP1,
OPTIONS-SIZE, FORMAT-NAME, RECEIVER,
RECEIVER-LENGTH, RECEIVER-LENGTH, QUS-EC.
ᑍ 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 >  PERFORM ERROR-FOUND.
Appendix B. Original Examples in Additional Languages B-167