ð1 NAME-OF-LIBRARY

PIC

X(1ð) VALUE

"QUEUELIB".

ð1 SIZE-OF-MSG

PIC S9(ð5) VALUE

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 t￿he

\API for the parameter.

\

MOVE 16 TO BYTES-PROVIDED.

\

\Initialize QCAPCMD options control block for CL process￿ing

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 t￿he

\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 b￿e

\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 t￿he

\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 BLanguages-167

Page 445
Image 445
IBM Version 4 manual Wait-Time, Msg Pic, Msg-Back Pic