Use selective prompting for CL commands

You can request to prompt for selected parameters within a command.

This is especially helpful when you are using some of the longer commands and do not want to be prompted for certain parameters.

Selective prompting can be used during interactive prompting or entered as source (in SEU) for use within a CL procedure or program. You can enter the source for selective prompting with SEU but you cannot use selective prompting while entering commands in SEU.

You can use selective prompting to:

The following restrictions apply to selective prompting:

User-specified values are marked with a special symbol (>) in front of the values in both selective and regular prompting. If a user-specified value on the parameter prompt is not preceded by this symbol, the command default is passed to the command processing program.

If PASSATR(*YES) is specified on the PARM, ELEM, or QUAL command definition statement, and the default value is changed using the Change Command Definition (CHGCMDDFT) command, the default value is shown as a user-specified value (using the > symbol) and not a default value. If a default value of a changed PARM, ELEM, or QUAL command definition statement is changed back to its original default value, the > symbol is removed.

You can press F5 while you are using selective prompting to again display those values initially shown on the display.

If a CL variable is used to specify a value for a parameter which is to be displayed through selective prompting, you can change the value on the prompt, and the changed value is used when the command is run. The value of the variable in the procedure or program is not changed. If a CL procedure contains the following:

OVRDBF ?*FILE(FILEA) ??TOFILE(&FILENAME) ??MBR(MBR1)

the three parameters, FILE, TOFILE, and MBR is shown on the prompt display. The value specified for the FILE parameter cannot be changed by you, but the values for the TOFILE and MBR parameters can be changed. Assume that the CL variable &FILENAME has a value of FILE1, and you change it to FILE2. When the command is run, the value of FILE2 is used, but the value of &FILENAME is not changed in the procedure. The following tables list the various selective prompting characters and the resulting action.

You Enter Value Displayed Protected Value Passed to CPP if Nothing Specified Marked with > Symbol
??KEYWORD() Default No Default No
??KEYWORD(VALUE) Value No Value Yes
?*KEYWORD() Default Yes Default No
?*KEYWORD(VALUE) Value Yes Value Yes
?<KEYWORD() Default No Default No
?<KEYWORD(VALUE) Value No Default No
?/KEYWORD() Default Yes Default No
?/KEYWORD(VALUE) Value Yes Default No
?-KEYWORD() None N/A Default N/A
?-KEYWORD(VALUE) None N/A Value N/A
?&KEYWORD() Default No Default No
?&KEYWORD(VALUE) Value No Default No
?%KEYWORD() Default Yes Default No
?%KEYWORD(VALUE) Value Yes Default No
You Enter Display Value When F5 Pressed or Blanked Out Description
??KEYWORD() Default Normal keyword prompt with command default.
??KEYWORD(VALUE) Value Normal keyword prompt with program specified default.
?*KEYWORD() Default Show protected prompt (as information) where command default is the only value used.
?*KEYWORD(VALUE) Value Show protected prompt (as information) where program specified value is the only value used. For example, when a value should be shown as information but not changed.
?<KEYWORD() Default Normal keyword prompt with command default.
?<KEYWORD(VALUE) Value Normal keyword prompt with program specified default.
?/KEYWORD() Default Reserved for IBM® use.
?/KEYWORD(VALUE) Value Reserved for IBM use.
?&KEYWORD() Default Normal keyword prompt with command default.
?&KEYWORD(VALUE) Value Normal keyword prompt with program specified default.
?%KEYWORD() Default Show protected prompt (as information) where command default is the only value used.
?%KEYWORD(VALUE) Value Show protected prompt (as information) where program specified value is the only value used. For example, when a value should be shown as information but not changed.

Selective prompting can be used with the QCMDEXC or QCMDCHK program. The format of the call is:

CALL PGM(QCMDEXC or QCMDCHK) PARM(command command-length)

Following is a brief description of the selective prompting characters:

Selective Prompting Character Description
?? The parameter is displayed and input-capable.
?* The parameter is displayed but is not input-capable. Any user-specified value is passed to the command processing program.
?< The parameter is displayed and is input-capable, but the command default is sent to the CPP unless the value displayed on the parameter is changed.
?/ Reserved for IBM use.
?– The parameter is not displayed. The specified value (or default) is passed to the CPP. Not allowed in prompt override programs.
?& The parameter is not displayed until F9=All parameters is pressed. Once displayed, it is input-capable. The command default is sent to the CPP unless the value displayed on the parameter is changed.
?% The parameter is not displayed until F9=All parameters is pressed. Once displayed, it is not input-capable. The command default is sent to the CPP.
Related concepts
Information returned from the prompt override program
Related tasks
QCMDEXC program
QCMDCHK program