Using selective prompting for CL commands

Selective prompting for CL commands 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:

  • Select the parameters for which prompting is needed.
  • Determine which parameters are protected.
  • Omit parameters from the prompt.

The following restrictions apply to selective prompting:

  • The command name or label must be preceded by a ? (question mark):
    • When one or more of the selective prompt options is ?- (question mark, minus).
    • To avoid getting a CPF6805 message (a message that indicates a diagnostic problem on the command although compilation is successful)
  • Parameters can be specified by position but they cannot be preceded by selective prompt characters.
  • A parameter must be in keyword form to be selectively prompted for.
  • Blanks cannot be entered between the selective prompt characters and the keyword.
  • Selective prompting is only applicable at a parameter level; that is, you cannot specify particular keyword values within a list of values.
  • ?- is not allowed in prompt override programs.
  • If a parameter is required, the ?? selective prompt must be used.

    You can tell that a parameter is required because the input slot is highlighted when the command is prompted.

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)

The following table contains 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. When 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. When displayed, it is not input-capable. The command default is sent to the CPP.