Length of CL command parameter value
The length (LEN) parameter is used to specify the length of a parameter.
For parameter types of *DATE
or *TIME
, *DATE
is
always 7 characters long and *TIME
is always 6 characters
long. The following shows the maximum length for each parameter type
and the default length for each parameter type for which you can specify
a length.
Data type | Maximum length | Default length |
---|---|---|
*DEC | 24 (9 decimal positions) | 15 (5 decimal positions) |
*LGL | 1 | 1 |
*CHAR | 5000 | 32 |
*NAME | 256 | 10 |
*SNAME | 256 | 10 |
*CNAME | 256 | 10 |
*GENERIC | 256 | 10 |
*HEX | 256 | 1 |
*X | (256 24 9) | (1 15 5) |
*VARNAME | 11 | 11 |
*CMDSTR | 20000 | 256 |
*PNAME | 5000 | 32 |
The maximum length that is shown here is the maximum allowed length for these parameter types when the command runs. However, the maximum length that is allowed for character constants in the command definition statements is 32 characters. This restriction applies to the CONSTANT, DFT, VALUES, REL, RANGE, SPCVAL, and SNGVAL parameters. There are specific lengths for input fields available when prompting for a CL command. The input field lengths are 1 through 12 characters and 17, 25, 32, 50, 80, 132, 256, and 512 characters. If a particular parameter has a length that is not allowed, the input field displays with the next larger field length. The IBM i CL command prompter displays a maximum input field of 512 characters, even if the parameter length is longer than 512 characters.