Prompt Control Definition (PMTCTL)

The Prompt Control (PMTCTL) statement specifies a condition that is tested to determine whether prompting is done for the parameters whose PARM statement referred to this PMTCTL statement. The PMTCTL statement must have a statement label that matches the label referred to in the Prompt control (PMTCTL) parameter of one or more PARM statements in the command definition source.

Parameters

Keyword Description Choices Notes
CTL Controlling keyword Name Required, Positional 1
COND Controlling conditions Values (up to 50 repetitions): Element list Required, Positional 2
Element 1: Relational operator *GT, *EQ, *GE, *NL, *LT, *NE, *LE, *NG, *SPCFD, *UNSPCFD
Element 2: Controlling keyword value Character value
NBRTRUE Number of true conditions Single values: *ALL
Other values: Element list
Optional
Element 1: Relational operator *GT, *EQ, *GE, *NL, *LT, *NE, *LE, *NG
Element 2: Number of true conditions 0-25
LGLREL Logical relation *AND, *OR Optional

Controlling keyword (CTL)

Specifies the name of the parameter that controls the prompting. The value of the parameter specified here is compared to the value specified in the Controlling conditions (COND) parameter. If the Prompt control program prompt (PMTCTLPGM parameter) of the PARM statement is coded for the parameter specified here, the value returned by the program specified in that PMTCTLPGM parameter is compared to the values specified on the Controlling conditions (COND) parameter. If the parameter specified here is a list or qualified name, only the first list item or qualifier is compared.

Controlling conditions (COND)

Specifies the condition against which the parameter specified on the Controlling keyword (CTL) parameter is tested. Up to 50 conditions can be specified.

*SPCFD
The condition is true, including the default value, if it is specified for the control parameter.
*UNSPCFD
The condition is true only if the control parameter is not specified. It is not true if the default value is specified.
relational-operator-value
Specify the relational operator and value used to compare the value of the control parameter to the value specified in the Controlling conditions (COND) parameter. Valid values are *GT, *EQ, *NL, *LT, *NE, *LE, and *NG.

Number of true conditions (NBRTRUE)

Specifies the number of conditions specified on the Controlling conditions (COND) parameter that must be true if the parameter is prompted for.

*ALL
All the conditions must be true.
relational-operator-value
Specify the relational operator and number used to compare the number of conditions that are true to the number specified in the Number of true conditions (NBRTRUE) parameter Valid values are *GT, *EQ, *GE, *NL, *LT, *NE, *LE, and *NG.

Logical relation (LGLREL)

Specifies, when PMTCTL statements are in a group, the logical relationship between this PMTCTL statement and the preceding PMTCTL statements in the group. This allows conditional prompting using more than one controlling parameter.

*AND
Performs a logical AND operation of the resulting condition for this PMTCTL statement with the previous PMTCTL statement.
*OR
Performs a logical OR operation of the resulting condition for this PMTCTL statement with the previous PMTCTL statement.

Examples

Example 1: Selective Prompting with One Control Parameter

A:    PMTCTL   CTL(TYPE) COND((*EQ *) (*EQ *LIST)) +
               NBRTRUE(*EQ 1)

If either TYPE(*) or TYPE(*LIST) is specified, the parameters which reference this PMTCTL statement are selected for prompting.

Example 2: Selective Prompting with Multiple Control Parameters Using Multiple PMTCTL Statements

B:    PMTCTL   CTL(P1)  COND((*EQ *ALL))
      PMTCTL   CTL(P1)  COND((*EQ *SOME))  LGLREL(*OR)
      PMTCTL   CTL(P2)  COND((*EQ *ALL))  LGLREL(*AND)
      PMTCTL   CTL(P1)  COND((*EQ *NONE))  LGLREL(*OR)
      PMTCTL   CTL(P2)  COND((*NE *ALL))  LGLREL(*AND)

The parameters which refers to this group of PMTCTL statements are selected for prompting if any of the following conditions exist:

Error messages

None