Figure 9-3 shows the relationship between the Create Command (CRTCMD) command, the command definition statements, and the command processing program.
Figure 9-3. Command Relationships for CL and HLL
If the command processing program is a program written in CL, the variables
that receive the parameter values must be declared to correspond to the type
and length specified for each PARM statement. The following shows this
correspondence. (Note the declare for the parameter ORDER in Figure 9-3.)
PARM Statement Type | PARM Statement Length | Declared Variable Type | Declared Variable Length |
---|---|---|---|
*DEC | x y1 | *DEC | x y1 |
*LGL | 1 | *LGL | 1 |
*CHAR | n | *CHAR | <=n2 |
*NAME | n | *CHAR | <=n2 |
*CNAME | n | *CHAR | <=n2 |
*SNAME | n | *CHAR | <=n2 |
*GENERIC | n | *CHAR | <=n2 |
*CMDSTR | n | *CHAR | <=n2 |
*DATE | 7 | *CHAR | 7 |
*TIME | 6 | *CHAR | 6 |
*INT2 | n | *CHAR | 2 |
*INT4 | n | *CHAR | 4 |
*UINT2 | n | *CHAR | 2 |
*UINT4 | n | *CHAR | 4 |
|
A program written in CL used as a command processing program can process binary values (such as *INT2 or *INT4). The program should receive these values as character fields. The binary built-in function (%BINARY) can be used to convert them to decimal values.
The difference between *INT2 or *INT4 and *UINT2 or *UINT4 is that the *INT 2 and *INT4 types are signed integers and the *UINT2 and *UINT4 types are unsigned integers. The default value for both *UINT2 and *UINT4 is 0. The *UINT2 and *UINT4 types have the same restrictions as the *INT and *INT4 types.
For examples of command processing programs, see Examples of Defining and Creating Commands.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.