Change Command (CHGCMD)

The Change Command (CHGCMD) command changes some of the attributes of a command definition. The command gives you the ability to specify a different command processing program to process the command. You 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 Change Command (CHGCMD) command do not have to be created again. The Change Command (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.

Parameters

Keyword Description Choices Notes
CMD Command Qualified object name Required, Key, Positional 1
Qualifier 1: Command Name
Qualifier 2: Library Name, *LIBL, *CURLIB
PGM Program to process command Single values: *SAME, *REXX
Other values: Qualified object name
Optional, Positional 2
Qualifier 1: Program to process command Name
Qualifier 2: Library Name, *LIBL, *CURLIB
REXSRCFILE REXX source file Single values: *SAME
Other values: Qualified object name
Optional
Qualifier 1: REXX source file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
REXSRCMBR REXX source member Name, *SAME, *CMD Optional
REXCMDENV REXX command environment Single values: *SAME, *COMMAND, *CPICOMM, *EXECSQL
Other values: Qualified object name
Optional
Qualifier 1: REXX command environment Name
Qualifier 2: Library Name, *LIBL, *CURLIB
REXEXITPGM REXX exit programs Single values: *SAME, *NONE
Other values (up to 8 repetitions): Element list
Optional
Element 1: Program Qualified object name
Qualifier 1: Program Name
Qualifier 2: Library Name, *LIBL, *CURLIB
Element 2: Exit code 2, 3, 4, 5, 7, 8, 9, 10
VLDCKR Validity checking program Single values: *SAME, *NONE
Other values: Qualified object name
Optional
Qualifier 1: Validity checking program Name
Qualifier 2: Library Name, *LIBL, *CURLIB
MODE Mode in which valid Single values: *SAME, *ALL
Other values (up to 3 repetitions): *PROD, *DEBUG, *SERVICE
Optional
ALLOW Where allowed to run Single values: *SAME, *ALL
Other values (up to 9 repetitions): *BATCH, *INTERACT, *BPGM, *IPGM, *BREXX, *IREXX, *EXEC, *BMOD, *IMOD
Optional
ALWLMTUSR Allow limited users *SAME, *NO, *YES Optional
HLPSHELF Help bookshelf Simple name, *SAME, *LIST, *NONE Optional
HLPPNLGRP Help panel group Single values: *NONE, *SAME
Other values: Qualified object name
Optional
Qualifier 1: Help panel group Name
Qualifier 2: Library Name, *LIBL, *CURLIB
HLPID Help identifier Character value, *SAME, *CMD, *NONE Optional
HLPSCHIDX Help search index Single values: *SAME, *NONE
Other values: Qualified object name
Optional
Qualifier 1: Help search index Name
Qualifier 2: Library Name, *LIBL, *CURLIB
CURLIB Current library Name, *SAME, *NOCHG, *CRTDFT Optional
PRDLIB Product library Name, *SAME, *NOCHG, *NONE Optional
PMTOVRPGM Prompt override program Single values: *SAME, *NONE
Other values: Qualified object name
Optional
Qualifier 1: Prompt override program Name
Qualifier 2: Library Name, *LIBL, *CURLIB
TEXT Text 'description' Character value, *SAME, *CMDPMT, *BLANK Optional
ENBGUI Enable GUI *YES, *NO, *SAME Optional

Command (CMD)

Specifies the command to be changed. The command can be either a user-defined command or an IBM-supplied command.

This is a required parameter.

Qualifier 1: Command

name
Specify the name of the command to be changed.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the command. If no library is specified as the current library for the job, QGPL is used.
name
Specify the name of the library where the command is located.

Program to process command (PGM)

Specifies the command processing program (CPP) that is to be called to process the command.

Single values

*SAME
The current CPP does not change.
*REXX
The CPP for this command is the REXX procedure identified on the REXX source member (REXSRCMBR) parameter.

Qualifier 1: Program to process command

name
Specify the name of the CPP that processes the command.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the program. If no library is specified as the current library for the job, QGPL is used.
name
Specify the name of the library where the program is located.

REXX source file (REXSRCFILE)

Specifies the source file containing the REXX procedure.

Single values

*SAME
The REXX source file and library do not change.

Qualifier 1: REXX source file

name
Specify the name of the source file.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the source file. If no library is specified as the current library for the job, QGPL is used.
name
Specify the name of the library where the source file is located.

REXX source member (REXSRCMBR)

Specifies the source member containing the REXX procedure that is the apparent command processing program (CPP).

*SAME
The member name does not change.
*CMD
The source member name is the same as the command name (the name specified on the CMD parameter).
name
Specify the name of the source member containing the REXX procedure.

REXX command environment (REXCMDENV)

Specifies the command environment that is active when the REXX command processing program (CPP) starts to run. The REXX interpreter calls this program to process commands encountered in the procedure. This environment can be changed through the REXX ADDRESS instruction.

Single values

*SAME
The command environment does not change.
*COMMAND
The control language (CL) command environment is used.
*CPICOMM
The Common Programming Interface (CPI) environment is used.
*EXECSQL
The Structured Query Language (SQL) Command environment is used. EXECSQL is the command environment used for CL commands that are imbedded with in a SQL procedure.

Qualifier 1: REXX command environment

name
Specify the name of the program to be called to process commands in the REXX procedure.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the program. If no library is specified as the current library for the job, QGPL is used.
name
Specify the name of the library where the program is located.

REXX exit programs (REXEXITPGM)

Specifies the exit programs to be used when the REXX command processing program (CPP) is started. A maximum of eight program and exit code combinations can be specified.

Single values

*SAME
The exit programs do not change.
*NONE
There are no exit programs for the REXX CPP.

Element 1: Program

Qualifier 1: Program

name
Specify the name of the exit program.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library list is used to locate the program. If no library is specified as the current library for the job, QGPL is used.
name
Specify the name of the library to be searched.

Element 2: Exit code

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).

Validity checking program (VLDCKR)

Specifies the program to be called to perform 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.

Single values

*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.

Qualifier 1: Validity checking program

name
Specify the name and library of the validity checking program that checks the validity of the command.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the program. If no library is specified as the current library for the job, QGPL is used.
name
Specify the name of the library where the validity checking program is located.

Mode in which valid (MODE)

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

Single values

*SAME
The modes of operation in which the command can be used do not change.
*ALL
The command is valid in all the types of modes: production, debug, and service.

Other values (up to 3 repetitions)

*PROD
The command is valid for production mode operations.
*DEBUG
The command is valid for debug mode operations.
*SERVICE
The command is valid for service mode operations.

Where allowed to run (ALLOW)

Specifies where the command can be processed.

Single values

*SAME
The environment in which the command can be processed does not change.
*ALL
The command can be processed 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.

Other values (up to 9 repetitions)

*BATCH
The command can be processed in a batch input stream, external to a compiled CL program.
*INTERACT
The command can be processed interactively, external to a compiled CL program.
*BPGM
The command can be processed in a compiled CL program that is called from batch entry.
*IPGM
The command can be processed in a compiled CL program that is called from interactive entry.
*BREXX
The command can be used in a REXX procedure run in a batch job.
*IREXX
The command can be used in a REXX procedure run in an interactive job.
*BMOD
The command can be used in a batch CL ILE program only.
*IMOD
The command can be used in a interactive CL ILE program 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.

Allow limited users (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 (the LMTCPB keyword on the Create User Profile (CRTUSRPRF) and Change User Profile (CHGUSRPRF) commands).

*SAME
The limited user authority 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.

Help bookshelf (HLPSHELF)

This parameter is no longer supported.

Help panel group (HLPPNLGRP)

Specifies the help panel group for this command.

Single values

*SAME
The panel group does not change.
*NONE
No help panel group is specified.

Qualifier 1: Help panel group

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

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the panel group. If no library is specified as the current library for the job, QGPL is used.
name
Specify the name of the library where the panel group is located.

Help identifier (HLPID)

Specifies the root name for all help section identifiers for this command. All help sections in the help panel group associated with this command will begin with this name.

*SAME
The help ID does not change.
*NONE
No help identifier is specified. *NONE is not allowed if a panel group name is specified for the Help panel group (HLPPNLGRP) parameter.
*CMD
The name of the command is to be used as the root for help section identifiers in the help panel group.
name
Specify the root name for the help section identifiers for this command.

Help search index (HLPSCHIDX)

Specifies the help search index to use when the search index function key is pressed from the help screen.

Single values

*SAME
The value does not change.
*NONE
No help search index is associated with this command.

Qualifier 1: Help search index

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

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the search index. If no library is specified as the current library for the job, the QGPL library is used.
name
Specify the name of the library where the search index is located.

Current library (CURLIB)

Specifies the name of the current library associated with the job being run.

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

*SAME
The current library for the command 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 complete. 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. QGPL is used as the current library.
name
Specify the name of the library to be 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.

Product library (PRDLIB)

Specifies the product library that is to be 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 menu started.

*SAME
The product library for the command does not change.
*NOCHG
The product library is not changed 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 complete.
name
Specify the name of the library to be used as the product library during command processing. The library need not exist when the command is created, but must exist when the command is processed. When command processing is completed, the product library is restored to its previous value. QTEMP cannot be specified for the product library.

Prompt override program (PMTOVRPGM)

Specifies the prompt override program (POP) to be called to replace (on the prompt display) the default values with the current actual values specified 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 visible on the initial prompt display. When values are input for the key parameters, the remaining parameters are shown on the display with the actual values instead of the default values.

Single values

*SAME
The prompt override program does not change.
*NONE
No prompt override program is specified.

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

Qualifier 1: Prompt override program

name
Specify the name of the prompt override program (POP).

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the prompt override program. If no library is specified as the current library for the job, QGPL is used.
name
Specify the name of the library where the prompt override program is located.

Text 'description' (TEXT)

Specifies the text that briefly describes the object.

*SAME
The text, if any, does not change.
*CMDPMT
The text description will be the same as the command title shown when the command is prompted.
*BLANK
No text is specified.
character-value
Specify no more than 50 bytes of text, enclosed in apostrophes.

Enable GUI (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.

Examples

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

*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.
CPF6216
Command &1 not valid for &2 command
CPF6219
Not authorized to library &2.