Source Code to Define a CL Command to Collect Session Data
CL CMD program T1520CM1 is shown in Figure 1.
This developer-defined command:
- Prompts the user to enter, in the following order:
Item name,Unit price, andNumber of items - Stores the input data in the following keyword parameters:
ITEM,PRICE, andQUANTITY.Note: These keyword parameters were defined in the DDS fileT1520DD1.
CMD PROMPT('CALCULATE TOTAL COST')
PARM KWD(ITEM) TYPE(*CHAR) LEN(20) RSTD(*NO) +
MIN(1) ALWUNPRT(*NO) PROMPT('Item name' 1)
PARM KWD(PRICE) TYPE(*DEC) LEN(10 2) RSTD(*NO) +
RANGE(0.01 99999999.99) MIN(1) +
ALWUNPRT(*YES) PROMPT('Unit price' 2)
PARM KWD(QUANTITY) TYPE(*INT2) RSTD(*NO) RANGE(1 +
9999) MIN(1) ALWUNPRT(*YES) +
PROMPT('Number of items' 3)