Command reference / prog

CRTCMD

Create Command

Creates a user-defined command definition that uses the same command processing support as IBM-supplied commands. The definition is stored in library QGPL or a user library. To change an existing command's definition, delete it with DLTCMD and create it again with CRTCMD; some values can instead be changed with CHGCMD. The command is built from command definition statements (CMD, PARM, ELEM, QUAL, DEP, PMTCTL) in a source file that CRTCMD processes.

Allowed environments: *ALL. Positional parameters: 4.

Restrictions

Parameters

CMD Command

Names the command to create, as a name and library. The name is required; the library defaults to the current library.

Type
*QUAL
Required
Yes
Case
Uppercase
*CURLIB
Created in the job's current library, or QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Command Command

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*CURLIB
Length
10
Case
Uppercase

Suggested / special values: *CURLIB

PGM Program to process command

Names the command processing program (CPP) that processes the command. It is not needed until run time, and is required.

Type
*QUAL
Required
Yes
Case
Uppercase

Suggested / special values: *REXX

*REXX
The CPP is the REXX procedure named on REXSRCMBR.
*LIBL
Search the thread's library list for the program.
*CURLIB
Use the job's current library to locate the program.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Program to process command Program to process command

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

SRCFILE Source file

Names the source file that holds the command definition statements. The default is QCMDSRC.

Type
*QUAL
Required
No
Case
Uppercase
*LIBL
Search the library list for the source file.
*CURLIB
Use the job's current library to locate the source file.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Source file Source file

Type
*NAME
Required
No
Default
QCMDSRC
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

SRCMBR Source member

Names the source member holding the command definition statements when SRCFILE is a database file.

Type
*NAME
Required
No
Default
*CMD
Length
10
Case
Uppercase

Suggested / special values: *CMD

*CMD
The member name is the same as the command name (CMD parameter).

SRCSTMF Source stream file

Gives the path name of a stream file holding the command definition statements. It cannot be combined with SRCFILE or SRCMBR. Absolute and relative path names are accepted.

Type
*CHAR
Required
No
Length
50
Case
Uppercase

REXSRCFILE REXX source file

Type
*QUAL
Required
No
Case
Uppercase
Qualified parts (object, then library; write LIBRARY/OBJECT)

REXX source file REXX source file

Type
*NAME
Required
No
Default
QREXSRC
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

REXSRCMBR REXX source member

Type
*NAME
Required
No
Default
*CMD
Length
10
Case
Uppercase

Suggested / special values: *CMD

REXCMDENV REXX command environment

Type
*QUAL
Required
No
Case
Uppercase
Qualified parts (object, then library; write LIBRARY/OBJECT)

REXX command environment REXX command environment

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

REXEXITPGM REXX exit programs

Type
*ELEM
Required
No
Case
Uppercase
Elements in order

Program Program

Type
*QUAL
Required
No
Case
Uppercase
Qualified parts (object, then library; write LIBRARY/OBJECT)

Program Program

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

Exit code Exit code

Type
*CHAR
Required
No
Length
10
Case
Uppercase

THDSAFE Threadsafe

Type
*CHAR
Required
No
Default
*NO
Length
5
Case
Uppercase

Allowed values: *NO, *YES, *COND

MLTTHDACN Multithreaded job action

Type
*CHAR
Required
No
Default
*SYSVAL
Length
7
Case
Uppercase

Allowed values: *SYSVAL, *RUN, *MSG, *NORUN

TEXT Text 'description'

Gives brief text describing the object, up to 50 bytes in apostrophes.

Type
*CHAR
Required
No
Default
*SRCMBRTXT
Length
50
Case
Mixed case

Suggested / special values: *SRCMBRTXT, *CMDPMT, *BLANK

*SRCMBRTXT
Text is taken from the source member.
*CMDPMT
Text is the same as the command title shown when prompted.
*BLANK
No text is specified.

OPTION Source listing options

Type
*CHAR
Required
No
Length
9
List limit
2
Case
Uppercase

Allowed values: *EVENTF, *NOEVENTF

VLDCKR Validity checking program

Type
*QUAL
Required
No
Default
*NONE
Case
Uppercase

Suggested / special values: *NONE

Qualified parts (object, then library; write LIBRARY/OBJECT)

Validity checking program Validity checking program

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

MODE Mode in which valid

Type
*CHAR
Required
No
Default
*ALL
Length
8
List limit
3
Case
Uppercase

Allowed values: *ALL, *PROD, *DEBUG, *SERVICE

ALLOW Where allowed to run

Sets where the command can be processed.

Type
*CHAR
Required
No
Default
*ALL
Length
9
List limit
9
Case
Uppercase

Allowed values: *ALL, *BATCH, *INTERACT, *BPGM, *IPGM, *BREXX, *IREXX, *EXEC, *BMOD, *IMOD

*ALL
Valid everywhere, including the QCMDEXC, QCAEXEC and QCAPCMD APIs.
*BATCH
Valid in a batch input stream, outside a compiled CL program.
*INTERACT
Valid interactively, outside a compiled CL program.
*BPGM
Valid in a compiled CL program called from batch entry.
*IPGM
Valid in a compiled CL program called from interactive entry.
*BREXX
Valid in a REXX procedure run in batch.
*IREXX
Valid in a REXX procedure run interactively.
*BMOD
Valid in a batch CL ILE program only.
*IMOD
Valid in an interactive CL ILE program only.
*EXEC
Can be passed as a character string to QCMDEXC, QCAEXEC or QCAPCMD. *BATCH or *INTERACT must also be specified.

ALWLMTUSR Allow limited users

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

MAXPOS Maximum positional parameters

Type
*UINT2
Required
No
Default
*NOMAX
Range
0 to 75
Case
Uppercase

Suggested / special values: *NOMAX

PMTFILE Message file for prompt text

Type
*ELEM
Required
No
Default
*NONE
Case
Uppercase

Suggested / special values: *NONE

Elements in order

Message file Message file

Type
*QUAL
Required
No
Case
Uppercase
Qualified parts (object, then library; write LIBRARY/OBJECT)

Message file Message file

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

Message text Message text

Type
*CHAR
Required
No
Default
*STATIC
Length
8
Case
Uppercase

Allowed values: *STATIC, *DYNAMIC

MSGF Message file

Type
*QUAL
Required
No
Case
Uppercase
Qualified parts (object, then library; write LIBRARY/OBJECT)

Message file Message file

Type
*NAME
Required
No
Default
QCPFMSG
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

HLPSHELF Help bookshelf

Type
*SNAME
Required
No
Default
*NONE
Length
10
Case
Uppercase

Suggested / special values: *NONE, *LIST

HLPPNLGRP Help panel group

Type
*QUAL
Required
No
Default
*NONE
Case
Uppercase

Suggested / special values: *NONE

Qualified parts (object, then library; write LIBRARY/OBJECT)

Help panel group Help panel group

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

HLPID Help identifier

Type
*CHAR
Required
No
Default
*NONE
Length
50
Case
Uppercase

Suggested / special values: *NONE, *CMD

HLPSCHIDX Help search index

Type
*QUAL
Required
No
Default
*NONE
Case
Uppercase

Suggested / special values: *NONE

Qualified parts (object, then library; write LIBRARY/OBJECT)

Help search index Help search index

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

CURLIB Current library

Type
*NAME
Required
No
Default
*NOCHG
Length
10
Case
Uppercase

Suggested / special values: *NOCHG, *CRTDFT

PRDLIB Product library

Type
*NAME
Required
No
Default
*NOCHG
Length
10
Case
Uppercase

Suggested / special values: *NOCHG, *NONE

PMTOVRPGM Prompt override program

Type
*QUAL
Required
No
Default
*NONE
Case
Uppercase

Suggested / special values: *NONE

Qualified parts (object, then library; write LIBRARY/OBJECT)

Prompt override program Prompt override program

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

AUT Authority

Sets public authority for the command: users without specific authority, not on an authorization list, and whose group profiles lack specific authority.

Type
*NAME
Required
No
Default
*LIBCRTAUT
Length
10
Case
Uppercase

Suggested / special values: *LIBCRTAUT, *USE, *ALL, *CHANGE, *EXCLUDE

*LIBCRTAUT
Use the CRTAUT value of the library the command is created in.
*CHANGE
All operations except those limited to the owner or object management.
*ALL
All operations except authorization list management; can also change ownership.
*USE
Basic operations such as running a program or reading a file; no changes.
*EXCLUDE
The user cannot access the command.

REPLACE Replace command

Sets whether an existing command with the same name and library is replaced. If so, the existing command is moved to library QRPLOBJ.

Type
*CHAR
Required
No
Default
*YES
Length
4
Case
Uppercase

Allowed values: *YES, *NO

*YES
Existing commands are replaced by the new version.
*NO
Existing commands are not replaced, and creating one with the same name is not allowed.

ENBGUI Enable GUI

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

Examples

CRTCMD CMD(PAYROLL) PGM(PAY076) SRCFILE(PAYSOURCE) AUT(*EXCLUDE)

Creates a private command PAYROLL from source file PAYSOURCE, processed by program PAY076. It is valid in batch input, CL programs, interactive entry, and when passed to QCMDEXC.

IBM command documentation

Generated from os/cl/catalog/CRTCMD.json and os/cl/help/CRTCMD.json.