system("CRTLIB LIB(QUEUELIB)");
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ 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). \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
system("CRTDTAQ DTAQ(QUEUELIB/EXAMPLEQ) MAXLEN(1ð)");
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ Send information to the data queue. \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
QSNDDTAQ("EXAMPLEQ ", /\ Data queue name \/
"QUEUELIB ", /\ Queue library name \/
DataLength, /\ Length of queue entry \/
"EXAMPLE "); /\ Data sent to queue \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ Receive information from the data queue. \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
QRCVDTAQ("EXAMPLEQ ", /\ Data queue name \/
"QUEUELIB ", /\ Queue library name \/
&DataLength, /\ Length of queue entry \/
&QueueData, /\ Data received from queue \/
WaitTime); /\ Wait time \/
printf("Queue entry information: %.1ðs\n", QueueData);
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ Delete the data queue. \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
system("DLTDTAQ DTAQ(QUEUELIB/EXAMPLEQ)");
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ Delete the library. \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
system("DLTLIB LIB(QUEUELIB)");
}
Note: For examples of the data queue program in additional languages, see “Data
Queue—Examples” on page B-165.
User Queue—ILE C Example
The following program illustrates how to use APIs to create and manipulate a user
queue.
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ \/
/\Program Name: UQUEUEX \/
/\ \/
/\Program Language: ILE C \/
Appendix A. Performing Tasks Using APIs—Examples A-17