In this installment of APIs by Example, Carsten Flensburg demonstrates how to create a command definition for the Create User Queue (QUSCRTUQ) API. The result is a CRTUSRQ command that you can easily use in your CL programs. This command's counterpart, the DLTUSRQ command, comes with OS/400 and does not need to be created manually.
Creating a command definition for an API is a useful technique because it adds syntax checking and self-documentation to the parameters for the API. It also makes it very easy to use the API in a CL program.
In the next installment of APIs by Example on February 19, Carsten will demonstrate how to use MI built-in functions and functions from the ILE C runtime library to work with user queues in an ILE RPG program.
Here's what the CRTUSRQ command looks like when prompted:
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Create User Queue (CRTUSRQ)
Type choices, press Enter.
User queue . . . . . . . . . . . Name
Library . . . . . . . . . . . *CURLIB Name, *CURLIB
Extended attribute . . . . . . . *NONE Name, *NONE
Sequence . . . . . . . . . . . . *FIFO *FIFO, *LIFO, *KEYED
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
In addition to the command itself, Carsten has supplied a *PNLGRP object that allows you to learn about the CRTUSRQ command by pressing your help key on the command prompt screen.
This utility demonstrates the Create User Queue API (QUSCRTUQ): http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/apis/quscrtuq.htm
You can retrieve the source code for this utility from http://www.iseriesnetwork.com/noderesources/code/clubtechcode/CrtUsrQ.zip .
The above source code was written by Carsten Flensburg. For questions regarding this tip, contact Carsten at flensburg@novasol.dk