Effect of changing the command definition of a CL command in a procedure or program

Some changes can be made to the command definition of a command with no further action. Other changes might require the program or procedure to be re-created, or might cause the program or procedure to function differently.

When a CL module or program is created, the command definitions of the commands in the procedure or program are used to generate the module or program. When the CL procedure or program is run, the command definitions are also used. If you specify a library name for the command in the CL procedure or program, the command must be in the same library at procedure creation time and at run time. If you specify *LIBL for the command in the CL procedure or program, the command is found, both at procedure creation and run time, using the library list (*LIBL).

You can make the following changes to the command definition statements for a command without recreating the modules and programs that use the command. Some of these changes are made to the command definition statements source, which requires the command to be re-created. Other changes can be made with the Change Command (CHGCMD) command.
  • Add an optional parameter in any position. Adding an optional parameter before the positional limit may affect any procedures, programs, and batch input streams that have the parameters specified in positional form.
  • Change the REL and RANGE checks to be less restrictive.
  • Add new special values. However, this could change the action of the procedure or program if the value could be specified before the change.
  • Change the order of the parameters. However, changing the order of the parameters that precede the positional limit will affect any procedures, programs, and batch input streams that have the parameters specified in positional form.
  • Increase the number of optional elements in a simple list.
  • Change default values. However, this may affect the operation of the procedure or program.
  • Decrease the number of required list items in a simple list.
  • Change a parameter from required to optional.
  • Change RSTD from *YES to *NO.
  • Increase the length when FULL(*NO) is specified.
  • Change FULL from *YES to *NO.
  • Change the PROMPT text.
  • Change the ALLOW value to be less restrictive.
  • Change the name of the command processing program if the new command processing program accepts the correct number and type of parameters.
  • Change the name of the validity checking program if the new validity checking program accepts the correct number and type of parameters.
  • Change the mode in which the command can be run as long as the new mode does not affect the old mode of the same command that is used in a CL procedure or program.
  • Change the TYPE to a compatible and less restrictive value. For example, change the TYPE from *NAME to *CHAR.
  • Change the MAX value to greater than 1.
  • Change the PASSATR and VARY values.

The following changes can be made to the command definition statements depending on what was specified in the CL procedure or program in which the command is used:

  • Remove a parameter.
  • Change the RANGE and REL values to be more restrictive.
  • Remove special values.
  • Decrease the number of elements allowed in a list.
  • Change the TYPE value to be more restrictive or incompatible with the original TYPE value. For example, change the TYPE value from *CHAR to *NAME or change *PNAME to *CHAR.
  • Add a SNGVAL parameter that was previously a list item.
  • Change the name of an optional parameter.
  • Remove a value from a list of values.
  • Increase the number of required list items.
  • Change a SNGVAL parameter to a SPCVAL parameter.
  • Change a simple list to a mixed list of like elements.
  • Change an optional parameter to a constant.
  • Change RTNVAL from *YES to *NO, or from *NO to *YES.
  • Change case value from *MIXED to *MONO.

The following changes can be made to the command definition statements, but may cause the procedure or program that uses the command to function differently:

  • Change the meaning of a value.
  • Change the default value.
  • Change a SNGVAL parameter to a SPCVAL parameter.
  • Change a value to a SNGVAL parameter.
  • Change a list to a list within a list.
  • Change case value from *MIXED to *MONO.

The following changes to the command definition statements require that the procedures or program using the command be re-created.

  • Addition of a new required parameter.
  • Removal of a required parameter.
  • Changing the name of a required parameter.
  • Changing a required parameter to a constant.
  • Changing the command processing program to or from *REXX

In addition, if you specify *LIBL as the qualifier on the name of the command processing program or the validity checking when the command is created or changed, you can move the command processing program or the validity checking to another library in the library list without changing the command definition statements.