MODIFY COMMAND / CMD

Read syntax diagramSkip visual syntax diagram MODify COMmandCMDcommandQueryVirtualSUBCmdsubcommandSetSUBCmdsubcommandIBMclass *RESETEPNamenamePRIVCLASSANYPRIVclassesclassesSILENTlyNOTSILENTly1IBMclasscRESETEPNamenamePRIVCLASSANYPRIVclassesclasses
Notes:
  • 1 Commands with multiple versions require that the IBMCLASS be specified when the PRIVCLASS or PRIVCLASSANY operand is used.

Authorization

Privilege Class: A

Purpose

Use MODIFY COMMAND or MODIFY CMD to redefine an existing CP command on the system. For more information about specifying generic command names, see Usage Note 1.

You can also redefine an existing CP command during initialization using the MODIFY COMMAND or MODIFY CMD configuration file statements. For more information, see MODIFY COMMAND / CMD Statement in z/VM: CP Planning and Administration.

Operands

command
is the name of the existing CP command that you are overriding. The variable command is a 1-character to 12-character alphanumeric string.
Query
tells CP that you are overriding a QUERY command.
Virtual
tells CP that you are overriding a QUERY VIRTUAL subcommand.
SUBCmd subcommand
is the name of the QUERY subcommand that you are overriding. The variable subcommand is a 1- to 12-character alphanumeric string. For more information about specifying generic subcommand names, see Usage Note 1.
Set
tells CP that you are overriding a SET command.
SUBCmd subcommand
is the name of the SET subcommand that you are overriding. The variable subcommand is a 1-character to 12-character alphanumeric string. For more information about specifying generic subcommand names, see Usage Note 1.
IBMclass *
tells CP to redefine all versions of the specified command or subcommand. If omitted, IBMCLASS * is the default.
IBMclass c
tells CP to redefine a specific version of the specified command or subcommand. The variable c can be any 1 of the following:
A
this is a system-control command to be used by the primary system operator.
B
this is a command for operational control of real devices.
C
this is a command to alter system storage.
D
this is a command for system-wide control of spool files.
E
this is a command to examine system storage.
F
this is a command for service control of real devices.
G
this is a general-use command used to control the functions of a virtual machine.
0
(zero) this command has no specific IBM® class assigned.
RESET
tells CP to restore the command to the originally defined settings.
EPName name
tells CP the name of the entry point that contains the code to process the command. The variable name must be a 1-character to 8-character string. The first character must be alphabetic or one of the following special characters: dollar sign ($), number sign (#), underscore (_), or at sign (@). The rest of the string can be alphanumeric characters, the 4 special characters ($, #, _, and @), or any combination thereof.
PRIVCLASSANY
tells CP that users with any privilege class can issue the command that you are redefining.
PRIVclasses classes
tells CP that only users with one or more of the specified privilege classes can issue the command that you are redefining. Whatever you specify on this operand will replace the current privilege classes. The variable classes is 1 or more privilege classes in the range A through Z, 1 through 6, or an asterisk (*). Privilege class * indicates all privilege classes (A-Z and 1-6).
Note: If you want more than one privilege class, specify your classes in one string of characters. Do not separate the classes with blank spaces. For example, specify privclasses abc123, not privclasses a b c 1 2 3.
SILENTly
tells CP that the responses from the command you are redefining can be suppressed by invoking it using the SILENTLY command. For more information, see SILENTLY.
Note: Response suppression is supported only for the ATTACH, DETACH, and GIVE commands.
NOTSILENTly
tells CP that the responses from the command you are redefining cannot be suppressed.

Usage Notes

  1. If you are making similar changes to several QUERY (or SET) subcommands that share common characters, you can use a generic name rather than issuing multiple MODIFY COMMAND or CMD commands. A generic name is a 1- to 12-character alphanumeric string with asterisks (*) in place of one or more characters and percent signs (%) in place of exactly one character. For example:
    modify command query subcmd tr*c% …
    redefines all QUERY subcommands that start with TR and have C as their next-to-last character.
  2. The subcommands that make up the set of QUERY subcommands are divided into two groups and are controlled by two separate MODIFY commands. For example, QUERY DASD is a subcommand and QUERY VIRTUAL DASD is a separate subcommand. You must specify the VIRTUAL operand on the MODIFY command if you wish to change the QUERY VIRTUAL DASD subcommand. Because of the additional granularity that is provided by the MODIFY command, you must issue two MODIFY commands if you wish to change both the virtual and non-virtual subcommands of QUERY. For example, to change all versions of the QUERY DASD and QUERY VIRTUAL DASD subcommands so that only user privilege class X can issue them, enter the following:
    modify cmd query virtual subcmd DASD ibmc * priv x
     
    modify cmd query subcmd DASD ibmc * priv x
    The first MODIFY command changes the QUERY VIRTUAL subcommands while the second changes the QUERY subcommands.
  3. Several commands in the system share generic command control blocks. For example, QUERY 000E (Class B version) shares the same generic command control block with QUERY L00E (Class B version). The determination of the actual command being issued is not made until the command handler gets control. The generic command blocks exist only for Class B and G commands. In addition, they exist on the virtual subcommand chain. In order to change these commands, you must specify the VIRTUAL SUBCMD * and the appropriate IBMCLASS. For example, to add a user privilege Class X to the Class B version, you would enter the following:
    modify cmd query virtual subcmd * ibmc b priv bx

    For more information, refer to Modifying a Command in z/VM: CP Planning and Administration.

  4. To define a new CP command or a new version (by IBM class) of an existing CP command, use the DEFINE COMMAND or CMD command (see DEFINE COMMAND / CMD).
  5. To define a new alias for an existing CP command, use the DEFINE ALIAS command (see DEFINE ALIAS).
  6. Once defined, an alias name cannot be used again. An alias cannot be modified or eliminated; it can only be disabled.
  7. To load the command processing code into the system execution space, use the CPXLOAD command (see CPXLOAD).
  8. To activate a CP command:
  9. To display the address of the CP command table entry block, the current IBM class, and the current privilege class for a specified CP command, use the LOCATE CMDBK command (see LOCATE CMDBK).
  10. To deactivate a CP command:
  11. To remove the command processing code from the system execution space, use the CPXUNLOAD command (see CPXUNLOAD).
  12. MODIFY COMMAND RESET will not allow a RESET to occur if the resulting command versions would have different EPNAMEs. This can occur if you change the EPNAME for a command then add a new version for that command. To avoid this restriction, you should add new versions of a command before changing the EPNAMEs associated with the command.
  13. The SILENTly and NOTSILENTly option must be applied to all versions of a command.
  14. For more information about user-defined commands, see z/VM: CP Exit Customization.

Responses

Response 1:

To change the CP SHUTDOWN command from privilege class A to privilege class S, enter the following:
modify command shutdown privclasses s
Ready;

Response 2:

To change the version of the CP SET PRIVCLASS command that allows users with any privilege class to issue the command to a version that allows only users with privilege class G and Z to issue the command, enter the following:
locate cmdbk set subcmd privc
Subcommand   CMDBK    Alias    IBMCLASS Privilege
PRIVCLASS    12345678 *           C     C
PRIVCLASS    76543218 *           0     <ANY>
Ready;
 
modify cmd set subcmd privc ibmclass 0 privclasses gz
Ready;
 
locate cmdbk set subcmd privc
Subcommand   CMDBK    Alias    IBMCLASS Privilege
PRIVCLASS    12345678 *           C     C
PRIVCLASS    76543218 *           0     GZ
------------ 58281098 *           0     <ANY>
Ready;
Issuing the LOCATE CMDBK commands before and after your MODIFY COMMAND command is not necessary, but it shows you how the command definition has changed.

Response 3:

To change all IBM class E QUERY subcommands to privilege class G, enter the following:
modify cmd query subcmd * ibmclass e privclasses g
Ready;
The preceding command does not change any QUERY VIRTUAL subcommands. To change them, enter the following:
modify cmd query virtual subcmd * ibmc e priv g
Ready;

Messages

  • HCP002E Invalid operand - operand
  • HCP003E Invalid option - command contains extra option(s) starting with option
  • HCP013E Conflicting option - option
  • HCP770E MODIFY is not valid for command {command|QUERY subcommand|SET subcommand}
  • HCP770E MODIFY is not valid for command {command|QUERY subcommand|SET subcommand} because different EPNAMEs would be set
  • HCP770E MODIFY RESET is not valid for command {command|QUERY subcommand|SET subcommand} because different EPNAMEs would be set
  • HCP6704E Missing token at end of line
  • HCP6706E Invalid command name - command
  • HCP6706E Invalid entry point name - epname
  • HCP6706E Invalid IBM class - c
  • HCP6706E Invalid privilege classes - classes
  • HCP6706E Invalid subcommand name - subcommand
  • HCP6841E You did not specify an IBM class for command command
  • HCP6842E Cannot find existing CP command
  • HCP6845E You must specify a privilege class other than 0