I was creating a command with what I am going to call a "list parameter", to allow the entry of up to ten libraries. While writing the Command Processing Program, CPP, I encountered something I could not find a good description of how to handle. Therefore, I am writing this post to give you a good example of how I did it.
I am not going to go into too much detail on how to create commands and their parameters as I covered many of the basics in two earlier posts: Creating your own commands, part 1 and Creating your own commands, part 2.
My example command, MYCMD, has just one parameter, which will be the list of up to ten libraries. The source for the command is as follows:
01 CMD PROMPT('List of libraries')
02 PARM KWD(LIBRARY) TYPE(*NAME) MIN(1) MAX(10) +
03 PROMPT('Libraries')
|
Line 2 and 3: The command parameter LIBRARY has a number of keywords:
- KWD: The keyword name for the parameter
- TYPE: It is a name type parameter, which means it is equivalent of ten long character
- MIN: The minimum number of entries that must be given
- MAX: The maximum number of allowed entries
- PROMPT: The description that appears on the screen



