Create Proxy Command (CRTPRXCMD)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Create Proxy Command (CRTPRXCMD) command creates a new user-defined proxy command definition object. The proxy command definition object will have an object type of *CMD.

Once created, the proxy command can be changed by the Change Proxy Command (CHGPRXCMD) command. Other command-specific interfaces that reference a proxy command will actually operate on the command specified for the Target command (TGTCMD) parameter. The target command can be a regular command or another proxy command. Up to 5 proxy commands can be chained together. The last target command in the chain must be a regular command. Using the Change Command (CHGCMD) command or the Change Command Default (CHGCMDDFT) command against the proxy command will change the target command. Prompting or running a proxy command will cause the target command to be prompted or run.

Other object operations not specific to commands will operate on the proxy command and will not affect the target command. For example, moving a proxy command to another library, saving a proxy command, or deleting a proxy command will only affect the proxy *CMD object; the target *CMD object is not affected.

Top

Parameters

Keyword Description Choices Notes
CMD Command Qualified object name Required, Positional 1
Qualifier 1: Command Name
Qualifier 2: Library Name, *CURLIB
TGTCMD Target command Qualified object name Required, Positional 2
Qualifier 1: Target command Name
Qualifier 2: Library Name, *LIBL, *CURLIB, *SYSTEM, *NLVLIBL
TEXT Text 'description' Character value, *BLANK, *TGTCMD Optional
AUT Authority Name, *LIBCRTAUT, *USE, *ALL, *CHANGE, *EXCLUDE Optional
REPLACE Replace command *YES, *NO Optional
Top

Command (CMD)

Specifies the proxy command to be created.

This is a required parameter.

Qualifier 1: Command

name
Specify the name of the proxy command to be created.

Qualifier 2: Library

*CURLIB
The proxy command is created in the current library for the job. If no library is specified as the current library for the job, QGPL is used.
name
Specify the name of the library where the proxy command is to be located.
Top

Target command (TGTCMD)

Specifies the target command used to process the command. This command is not needed until the command is used in prompting, compiling, or running the proxy command. The parameters specified for the proxy command are passed to the target command for validation and interpretation. The target command can be a regular command or another proxy command. Up to 5 proxy commands can be chained together. The last target command in the chain must be a regular command.

This is a required parameter.

Qualifier 1: Target command

name
Specify the name of the target command for this proxy 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 command. If no library is specified as the current library for the job, QGPL is used.
*SYSTEM
Only the QSYS library is used to locate the command. If an exit program is registered for the QIBM_QCA_CHG_COMMAND exit point, the exit program will be allowed to change the command.
*NLVLIBL
Only the national language version (NLV) libraries in the library list and the QSYS library will be searched for the command. If an exit program is registered for the QIBM_QCA_CHG_COMMAND exit point, the exit program will be allowed to change the command.
name
Specify the name of the library where the command is located.
Top

Text 'description' (TEXT)

Specifies the text that briefly describes the object.

*TGTCMD
The text description of the target command will be used as the text description of the proxy command. If the target command does not exist when this command is run, the text description of the proxy command will be the qualified name of the target command.
*BLANK
No text is specified.
'description'
Specify no more than 50 characters of text, enclosed in apostrophes.
Top

Authority (AUT)

Specifies the authority you are giving to users who do not have specific authority for the object, who are not on an authorization list, and whose group profile or supplemental group profiles do not have specific authority for the object.

*USE
The user can perform basic operations on the object, such as prompting or running the command. The user cannot change the object. Use (*USE) authority provides object operational (*OBJOPR), read (*READ), and execute (*EXECUTE) authorities.
*LIBCRTAUT
The system determines the authority for the object by using the value specified on the Create authority (CRTAUT) parameter on the Create Library command (CRTLIB) for the library containing the object to be created. If the value specified on the Create authority (CRTAUT) parameter is changed, the new value will not affect any existing objects.
*CHANGE
The user can perform all operations on the object except those limited to the owner or controlled by object existence (*OBJEXIST) and object management (*OBJMGT) authorities. The user can change and perform basic functions on the object. *CHANGE authority provides object operational (*OBJOPR) authority and all data authority. If the object is an authorization list, the user cannot add, change, or remove users.
*ALL
The user can perform all operations except those limited to the owner or controlled by authorization list management (*AUTLMGT) authority. The user can control the object's existence, specify the security for the object, change the object, and perform basic functions on the object. The user also can change ownership of the object.
*EXCLUDE
The user cannot access the object.
name
Specify the name of an authorization list. Users included on the authorization list are granted authority to the object as specified by the list. The authorization list must exist when the object is created.
Top

Replace command (REPLACE)

Specifies whether or not an existing commmand object with the same name and library as the command being created should be replaced.

If you specify *YES and a command object already exists with the same name and in the same library, the existing command is renamed and moved to library QRPLOBJ, and will be deleted the next time an IPL of the operating system occurs.

*YES
If the create operation is successful, the existing command is replaced by the new command.
*NO
An existing command is not replaced, and the creation of a new command with the same name and library as an existing command is not allowed.
Top

Examples

CRTPRXCMD CMD(QGPL/WJ) TGTCMD(WRKJOB)
          TEXT('WRKJOB Shortcut')

The proxy command named WJ is created into library QGPL. When the WJ command is run or prompted, the target command WRKJOB in the library list will be used to process the WJ command parameters.

Top

Error messages

*ESCAPE Messages

CPF0201
Command &2 not created in library &3.
Top