C\ Beginning of mainline
C\
C\ Initialize the error code parameter. To signal exceptions to
C\ this program by the API, you need to set the bytes provided
C\ field of the error code to zero. Because this program has
C\ exceptions sent back through the error code parameter, it sets
C\ the bytes provided field to the number of bytes it gives the
C\ API for the parameter.
C\
C EVAL QUSBPRV = %SIZE(QUSEC)
C\
C\ Initialize QCAPCMD options control block for CL processing
C\
C EVAL QCACMDPT = ð
C EVAL QCABCSDH = 'ð'
C EVAL QCAPA = 'ð'
C EVAL QCACMDSS = 'ð'
C EVAL QCAMK = \BLANKS
C EVAL QCAERVED = \LOVAL
C\
C\ Create library QUEUELIB
C\
C EVAL CMD_STR = CRTLIB
C EVAL LEN_STR = %SIZE(CRTLIB)
C\
C EXSR EXEC_CMD
C\
C\ Create a data queue called EXAMPLEQ in library QUEUELIB. The
C\ queue will have a maximum entry length set at 1ð, and will be
C\ FIFO (first-in first-out).
C\
C EVAL CMD_STR = CRTDQ
C EVAL LEN_STR = %SIZE(CRTDQ)
C\
C EXSR EXEC_CMD
C\
C\ Send information to the data queue.
C\
C CALL 'QSNDDTAQ'
C PARM 'EXAMPLEQ ' NAME_OF_Q
C PARM 'QUEUELIB ' NAME_OF_LB
C PARM MSG_SZ 5 ð
C PARM 'EXAMPLE ' MSG
C\
C\ Retrieve information from the data queue.
C\
C CALL 'QRCVDTAQ'
C PARM 'EXAMPLEQ ' NAME_OF_Q
C PARM 'QUEUELIB ' NAME_OF_LB
C PARM MSG_SZ
C PARM MSG_BACK
C PARM ð WAIT_TIME 5 ð
C\
C\ Display the returned message
C\
C DSPLY MSG_BACK
C\
C\ Delete the data queue
Appendix B. Original Examples in Additional Languages B-173