I have this command which will require the user to input the first field.
CMD PROMPT('TEST')
PARM KWD(NAME) TYPE(*CHAR) LEN(10) PROMPT('NAME') +
MIN(01)
PARM KWD(TYPE) TYPE(*CHAR) LEN(05) PROMPT('TYPE') +
DFT(*OPT1) VALUES(*OPT1 *OPT2) RSTD(*YES)
If I change the order into like this, then the NAME field is not required anymore.
CMD PROMPT('TEST')
PARM KWD(TYPE) TYPE(*CHAR) LEN(05) PROMPT('TYPE') +
DFT(*OPT1) VALUES(*OPT1 *OPT2) RSTD(*YES)
PARM KWD(NAME) TYPE(*CHAR) LEN(10) PROMPT('NAME') +
MIN(01)
Spool file will also show this: Required parameter not allowed after optional parameter. Optional parameter assumed.
Is there a way to make the 2nd field mandatory if the layout of the fields is like this or this is already a limitation?
You can change the order they are displayed using
PROMPT(... order)Like below :