CHGCMD (Change Command)

CHGCMD Command syntax diagram

 

Purpose

The Change Command (CHGCMD) command changes some of the attributes of a command definition. It can specify a different command processing program (CPP) to process the command; it can also change the type of operating environment (production, debug, or service) in which the command can be processed and the text description of the command. CL programs that use the command being changed by the CHGCMD command do not have to be re-created. The CHGCMD command does not change the parameter descriptions or validity checking information in the command definition object.

 

Restrictions

  1. The user must have object management authority for the command that is being changed.
  2. The CHGCMD command can be used to change only the attributes of a created CL command. That is, those attributes that were specified on the Create Command (CRTCMD) command. The CHGCMD command cannot be used to change attributes of statements, such as command definition statements.
  3. The CHGCMD command should not be used to change the command processing program (PGM parameter), the validity checking program (VLDCKR parameter), or the prompt override program (PMTOVRPGM parameter) of an IBM-supplied command.
  4. If the CHGCMD command is used to change the command processing program (PGM parameter), the validity checking program (VLDCKR parameter), or the prompt override program (PMTOVRPGM parameter), the threadsafe attribute of the command will be set to *NO. You must use the Create Command (CRTCMD) command to set the threadsafe attribute to *YES or *COND.

 

Required Parameters

CMD
Specifies the qualified name of the command being changed. The command can be either a user-defined command or IBM-supplied command.

The name of the command can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

command-name: Specify the name of the command being changed.

 

Optional Parameters

PGM
Specifies the qualified name of the command processing program (CPP) that processes the command.

*SAME: The value does not change.

*REXX: The CPP for this command is the REXX procedure identified on the REXSRCMBR and REXSRCFILE parameters.

The name of the program can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

program-name: Specify the name of the CPP processing the command.

REXSRCFILE
Specifies the qualified name of the REXX source file containing the REXX procedure that is the command processing program (CPP).

*SAME: The REXX source file does not change.

The name of the REXX source file can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

source-file-name: Specify the name of the source file that contains the source member that is used.

REXSRCMBR
Specifies the source member containing the REXX procedure that functions as the command processing program (CPP).

*SAME: The value does not change.

*CMD: The source member name is the same as the command name (the name specified on the CMD parameter).

source-member-name: Specify the name of the source member that contains the REXX procedure.

REXCMDENV
Specifies the command environment that is active when the REXX CPP starts to run. If the iSeries 400 control language (CL) environment is not used, a program can be called to set the environment. The REXX interpreter calls this program to process commands encountered in the procedure. This environment can be changed with the REXX ADDRESS instruction.

*SAME: The value does not change.

*COMMAND: The iSeries 400 control language (CL) command environment is used.

*CPICOMM: The Common Programming Interface (CPI) for Communications command environment is used. CPICOMM is the command environment used for CL commands that are imbedded within a REXX procedure.

*EXECSQL: The Structured Query Language (SQL) Command environment is used. EXECSQL is the command environment used for CL commands tht are imbedded within a SQL procedure.

The name of the program can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

program-name: Specify the name of the program to process commands encountered by the REXX program.

REXEXITPGM
Specifies the exit program to be used when the REXX interpreter is started. This parameter can be specified as a single value (*SAME or *NONE) or as a list of two values (elements).

*SAME: The value does not change.

*NONE: There are no REXX interpreter exit programs for this call of the CPP.

The name of the program can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

Element 1: Name of the Exit Program

program-name: Specify the name of the exit program.

Element 2: Value of the Exit Code

exit-code: Specify one of the following values for the exit code:

Exit-code
Description
2
The associated program is called whenever an external function or subroutine has been called by the REXX program. The exit program is then responsible for locating and calling the requested routine.
3
The associated program is called whenever the interpreter is going to call a command. The exit program is responsible for locating and calling the command given the command string and the current environment name.
4
The associated program is called whenever a REXX instruction or function attempts an operation on the REXX external data queue.
5
The associated program is called when session input or output operations are attempted.
7
The associated program is called after running each clause of the REXX procedure to determine whether it should be halted.
8
The associated program is called after running each clause of the REXX program to check whether tracing should be turned on or off.
9
The associated program is called before interpretation of the first instruction of a REXX procedure (including REXX procedures called as external functions and subroutines).
10
The associated program is called after interpretation of the last instruction of a REXX procedure (including REXX procedures called as external functions and subroutines).

VLDCKR
Specifies the qualified name of a program that does additional validity checking on the parameters in the command being processed. The validity checker is called to do additional user-defined validity checking beyond that specified by the command definition statements in the source file, and beyond the syntax checking that is done on the command when it is compiled.

*SAME: The value does not change.

*NONE: There is no separate validity checking program for this command. All validity checking is done by the command analyzer and the command processing program. Whenever the command is processed or checked for validity, provided variables and expressions are not used.

The name of the validity checking program can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

program-name: Specify the name of the validity checker program that checks the validity of the command.

MODE
Specifies the types of operating environments in which the Change Command (CHGCMD) command can be used. One or more of the modes can be specified.

*SAME: The value does not change.

*ALL: The command is valid in all types of operation: the production, debug, and service modes.

*PROD: The command is valid for the production mode.

*DEBUG: The command is valid for the debug mode.

*SERVICE: The command is valid for the service mode.

ALLOW
Specifies where the command can be processed. One or more of the following options can be specified.

*SAME: The value does not change.

*ALL: The command is valid in a batch input stream, in a CL program, in a REXX procedure, in a CL ILE module, or when processed interactively. It can also be passed to the system program QCMDEXC (or QCAEXEC) for processing.

*BATCH: The command can be processed in a batch input stream that is external to a compiled CL program.

*INTERACT: The command is valid when processed interactively, external to a compiled CL program.

*BPGM: The command can be processed in a compiled CL OPM program or ILE-CL module that is called from batch entry.

*IPGM: The command can be processed in a compiled CL OPM program or ILE-CL module that is called from an interactive entry.

*BREXX: The command can be used in a REXX procedure that is run in batch job.

*IREXX: The command can be used in a REXX procedure that is run in an interactive job.

*BMOD: The command can be used in a batch CL ILE module only.

*IMOD: The command can be used in an interactive CL ILE module only.

*EXEC: The command can be used as a parameter on the CALL command and be passed as a character string to the system program QCMDEXC (or QCAEXEC) for processing. If *EXEC is specified, either *BATCH or *INTERACT must also be specified.

ALWLMTUSR
Specifies whether the command can be entered from the command line on a menu by a user whose profile is set for limited capabilities. (LMTCPB keyword on the Create User Profile (CRTUSRPRF) and Change User Profile (CHGUSRPRF) commands.)

*SAME: The value does not change.

*NO: This command cannot be entered from the command line on a menu by a user whose profile is set for limited capabilities.

*YES: This command can be entered from the command line on a menu by a user whose profile is set for limited capabilities.

HLPSHELF
Specifies a bookshelf name, or a list of bookshelves, that is to be used when the InfoSeeker key is pressed from a help display.

*SAME: The bookshelf does not change.

*LIST: The list of bookshelves in the user's bookpath will be displayed.

*NONE: No bookshelf is specified. InfoSeeker will not be available from the help display.

bookshelf-name: Specify the bookshelf name.

Note: If both a HLPSHELF and HLPSCHIDX parameter value are specified, an error message is issued when the command is changed.

HLPPNLGRP
Specifies the qualified name of the help panel group for this command.

*SAME: The value does not change.

*NONE: No help panel group is specified.

Note: If *NONE is specified on this parameter and a value is specified on the HLPID parameter, an error message is issued when the command is run.

The name of the panel group can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

panel-group-name: Specify the name of the help panel group for this command.

HLPID
Specifies the name of the general help module for the help identifiers for this command.

*SAME: The value does not change.

*NONE: No help identifier is specified.

Note: If *NONE is specified on this parameter and a value is specified on the HLPPNLGRP parameter, an error message is issued when the command is run.

*CMD: The name of the command is used as the first half of all the names for help IDs.

help-ID-name: Specify the name of the general help module for the help identifiers for this command.

HLPSCHIDX
Specifies the qualified name of the help search index to use when the search index function key is pressed from the help screen.

*SAME: The value does not change.

*NONE: No help search index is associated with this command.

The name of the search index can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

search-index-name: Specify the name of the search index to be used when the search index function key is pressed.

Note: If both a HLPSHELF and HLPSCHIDX parameter value are specified, an error message is issued when the command is changed.

CURLIB
Specifies the name of the library being used as the current library for jobs initiated by this user profile.

Note: This library is also the current library when the validity checking program (if any) is processed for the command.

*SAME: The value does not change.

*NOCHG: The current library is not changed for the processing of this command. If the current library is changed during processing of the command, the change remains in effect after command processing is complete.

*CRTDFT: There is no current library active during processing of the command. The current library that was active before command processing is restored when processing is completed.

If *CURLIB is specified as the to-value for any single values or special values for this command, or for any command processed while there is no current library active, the QGPL library is used as the current library.

library-name: Specify the name of the library used as the current library. The library need not exist when the command is created, but must exist when the command is processed. When command processing is completed, the current library is restored to its previous value. If the current library is changed during command processing by the Change Library List (CHGLIBL) command or Change Current Library (CHGCURLIB) command, the change is effective only until the command is processed. QTEMP cannot be specified for the current library.

PRDLIB
Specifies the name of the product library that is in effect during the processing of the command.

Note: The product library for a command or menu remains in the library list while a command or menu is active, unless another command or menu changes the product library. When a command or menu that changed the product library ends, the product library is restored to what it was when the command or library started.

*SAME: The value does not change.

*NOCHG: The product library does not change when processing of the command starts. If the product library is changed during the processing of the command, the change remains in effect after command processing is complete.

*NONE: There is no product library in the job's library list. The product library is restored to its previous value when command processing is completed.

library-name: Specify the name of the library used as the current library. The library need not exist when the command is created, but must exist when the command is processed. When command processing is completed, the current library is restored to its previous value. If the current library is changed during command processing by the Change Library List (CHGLIBL) command or Change Current Library (CHGCURLIB) command, the change is effective only until the command is processed. QTEMP cannot be specified for the current library.

PMTOVRPGM
Specifies the qualified name of the prompt override program (POP) that replaces (on the prompt display) the default values with the current actual values for the parameter. If a POP is specified, the key parameters (specified as KEYPARM(*YES) on the PARM statement in the command definition source) are the only parameters shown on the initial prompt display. When values are input for the key parameters, the remaining parameters are shown on the screen with the actual values instead of the default values.

*SAME: The value does not change.

*NONE: No prompt override program is specified.

Note: If *NONE is specified when key parameters exist in the command definition source (KEYPARM(*YES) specified on the PARM statement), a warning message is issued when the command is created, and KEYPARM(*NO) is assumed for all parameters.

The name of the prompt override program can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

program-name: Specify the name of the prompt override program.

ENBGUI
Specifies whether the command prompt panels are enabled for conversion to a graphical user interface.

*SAME: The value does not change.

*NO: The command prompt panels are not enabled for conversion to a graphical user interface.

*YES: The command prompt panels are enabled for conversion to a graphical user interface by including information about the panel content in the 5250 data stream.

TEXT
Specifies the text that briefly describes the command. More information is in Commonly used parameters.

*SAME: The value does not change.

*BLANK: No text is specified.

'description': Specify no more than 50 characters of text, enclosed in apostrophes.

Example for CHGCMD

CHGCMD  CMD(PAYROLL)  VLDCKR(LIB01/PAYVLDPGM)

The validity checking program for the PAYROLL command is the program named PAYVLDPGM located in library LIB01. All other attributes of the PAYROLL command remain the same.

Error messages for CHGCMD

*ESCAPE Messages

CPF6209
Library &1 not found.
CPF6210
Command &1 in library &2 not found.
CPF6211
Not authorized to change command &1.
CPF6212
Command &1 not changed.
CPF6213
Cannot allocate command &1 in library &2.
CPF6214
Errors detected while changing command &1.
CPF6215
Command &1 in library &2 cannot be changed.
CPF6219
Not authorized to library &2.