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 Z-ADD16 QUSBNB
C\
C\ Initialize QCAPCMD options control block for CL processing
C\
C Z-ADDð QCABCB
C MOVE 'ð' QCABCC
C MOVE 'ð' QCABCD
C MOVE 'ð' QCABCF
C MOVE \BLANKS QCABCG
C MOVE \LOVAL QCABCH
C\
C\ Create library QUEUELIB
C\
C MOVELCRTLIB CMDSTR
C Z-ADD2ð LENSTR
C\
C EXSR EXCCMD
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 MOVELCRTDQ CMDSTR
C Z-ADD42 LENSTR
C\
C EXSR EXCCMD
C\
C\ Send information to the data queue.
C\
C CALL 'QSNDDTAQ'
C PARM 'EXAMPLEQ'QUENAM 1ð
C PARM 'QUEUELIB'LIBNAM 1ð
C PARM 1ð MSGSZ
C PARM 'EXAMPLE' MSG
C\
C\ Retrieve information from the data queue.
C\
C CALL 'QRCVDTAQ'
C PARM 'EXAMPLEQ'QUENAM 1ð
C PARM 'QUEUELIB'LIBNAM 1ð
C PARM 1ð MSGSZ
C PARM MSGBCK 1ð
C PARM ð WAITTM
C\
C\ Display the returned message
C\
C DSPLY MSGBCK
C\
C\ Delete the data queue
C\
C MOVELDLTDQ CMDSTR
B-170 System API Programming V4R1