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, and Number of items
  • Stores the input data in the following keyword parameters: ITEM, PRICE, and QUANTITY.
    Note: These keyword parameters were defined in the DDS file T1520DD1.
Figure 1. T1520CM1 — CL Command Source to Receive Input Data
          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)