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 1
C PARM 'QUEUELIB ' NAME_OF_LB 1
C PARM 1 MSG_SZ 5
C PARM 'EXAMPLE ' MSG 1
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 1 MSG_SZ
C PARM MSG_BACK 1
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