Most i5/OS commands have parameters to fine-tune the purpose or the task to be performed by the command. For example, the Display Message (DSPMSG) command uses a parameter to determine what messages to display. If parameters didn't exist, you would need a different command for each message queue, which would be impractical.
The command prompter can be activated by keying in the name of the command at the command line and pressing F4 instead of Enter. When you do this, the system presents the prompt panel for that command. For example, you can invoke the prompter for the Change Library List (CHGLIBL) shown in Figure 9.7 by entering the following command:
CHGLIBL ... press F4:
Figure 9.7: Sample command prompter.
Figure 9.7: Sample command prompter.
You also can invoke the command prompter by typing a question mark (?) immediately followed by the command name at the command line and pressing the Enter key.
In the previous illustration, the CHGLIBL command has two parameters. The first parameter ("Libraries for current job") is a list, while the second parameter ("Current library") is a normal parameter.
The command prompter gives you input fields so that you can change the values of the parameters. On the right side of the screen, it shows you what values are acceptable. For example, the first parameter allows entry of a Name, *SAME, or *NONE. The second parameter allows a Name, *SAME, or *CRTDFT.
The command parameter names are not shown unless you press F11 or change your user profile using USROPT(*CLKWD). The first parameter has a keyword of LIBL, and the second parameter's keyword is CURLIB.
Simple parameters, like CURLIB, are easy to change by typing over the old value (which shows *CRTDFT in the example). List parameters, like LIBL, are more difficult. If you only need to replace one element in the list for another, proceed as you would with a simple parameter: Type over the old value and press Enter.
If you want to remove one of the elements of the list, blank it out and press Enter. Optionally, you can type a less-than (<) character, at least one space, and press Enter. Both methods yield the same result.
If you want to insert a new element to the list, somewhere in the middle, type a greater-than (>) symbol in the input field before what you want to insert, at least one space, and press Enter. The command prompter will present a different panel, where you can type one or more new elements. When you are done inserting, press Enter. The system returns to the command prompter with the new values already inserted.
If you want to add a new element at the bottom of the list, type a plus (+) sign and at least one space on any of the elements of the list and press Enter. The system presents a different panel to let you type the new elements to be inserted. When you are done, press Enter again and the system takes you back to the command prompter, with the new values already appended at the end of the list.
Sometimes you need to type more characters than will fit in the input field provided by the prompter. This happens when you are entering a CL program and one of the parameters is an expression rather than a variable name. To lengthen the input field, type an ampersand (&) and at least one space and press Enter. The command prompter will lengthen the input field to the next higher length it provides.
Although the process of lengthening a parameter's input field can be repeated several times (until the input field reaches its maximum length of 512 spaces), it doesn't guarantee that the command prompter is going to accept that many characters. For example, the Display User Profile (DSPUSRPRF) command expects a user profile name in the USRPRF parameter. Because it is a name, it can be up to 10 characters long. You can lengthen the input field to 32 characters and even type 32 characters in the input field. When you press Enter, however, the prompter will reject your input because it is too long.
The command prompter provides help. Press F13 to display instructions about using the command prompter if you are not sure about all the features you have at your fingertips.
The Help key also is available. It provides cursor-sensitive help text that explains the purpose, allowed values, and special rules about all parameters. If you move the cursor above the first parameter and press Help, the system displays help text to explain the purpose of the command itself. You can also press F1 instead of the Help key.
While the cursor is on an input field, you can also press F4 (or type a question mark "?" and at least one space, then press Enter) to obtain a list of allowed values for the parameter in question.
This section discusses the most important function keys available with the command prompter. F1 works like the Help key. F2 is allowed only while help is active, to display the extended help. Extended help shows all help available for the command. F3 and F12 cancel the command prompter.
F4 lists the allowed values for a parameter. If the parameter expects a command string (such as the THEN parameter of the IF command, or the CMD parameter of the SBMJOB command), F4 can be used to invoke the command prompter for the command you are entering.
For example, suppose you need to submit the DSPLIB command to batch. Begin by typing SBMJOB at the command line, and press F4 to prompt the SBMJOB command. The first parameter, CMD, is where you enter the command you want to submit for batch execution. Type DSPLIB and press F4 again. The system prompts the DSPLIB command. It is one prompt within another. Figure 9.8 illustrates this process.
Figure 9.8: Nested prompting in commands.
F5 returns all parameters to their original default values (if you have changed them, but not yet pressed Enter). If you lengthened any parameter input fields using the ‘&’ character, F5 returns the input fields to their original length.
F9 causes all parameters to be displayed. Even those parameters that are not dependent on the values in parameters that have already been filled in are displayed.
F10 is not always available. When it is, it displays additional parameters not normally shown at first.
F11 displays the parameter keywords or omits them if they are already present. You can change your user profile to USROPT(*CLKWD) if you would rather see the keywords all the time.
F14 displays the entire command string, including all the parameters to which you have given values. The string is displayed the way the command would look if you had entered it manually at the command line or included it in a CL program. This function key is helpful for documentation purposes.