Defining a dependent relationship between CL command parameters
A dependent relationship is a required relationship that must exist between parameters of a CL command.
If a required relationship exists between parameters, and if parameter values must be checked when the command is run, use the Dependent (DEP) statement to define that relationship. Using the DEP statement, you can perform the functions that are listed as follows:
- Specify the controlling conditions that must be true before the parameter relationships defined in the PARM parameter need to be true (CTL).
- Specify the parameter relationships that require testing if the controlling conditions defined by CTL are true (PARM).
- Specify the number of parameter relationships that are defined on the associated PARM statement that must be true if the control condition is true (NBRTRUE).
- Specify the message identifier of an error message in a message file that the system is to send to the display station user if the parameter dependencies have not been satisfied.
In the following example, if the display station user specifies the TYPE(LIST) parameter, the display station user must also specify the ELEMLIST parameter.
DEP CTL(&TYPE *EQ LIST) PARM(ELEMLIST)
In the following example, the parameter &WRITER
must never be equal to the parameter &NEWWTR. If this condition
is not true, message USR0001 is issued to the display
station user.
DEP CTL(*ALWAYS) PARM((&WRITER *NE &NEWWTR)) MSGID(USR0001)
In the following example, if the display station user specifies the FILE parameter, the display station user must also specify both the VOL and LABEL parameters.
DEP CTL(FILE) PARM(VOL LABEL) NBRTRUE(*EQ 2)