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
- CRTCMD can create the definition of an actual CL command only. It cannot create definitions of the command definition statements themselves.
Parameters
CMD
Command
Names the command to create, as a name and library. The name is required; the library defaults to the current library.
*CURLIB- Created in the job's current library, or QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Command
Command
Library
Library
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.
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
Library
Library
Suggested / special values:
*LIBL, *CURLIB
SRCFILE
Source file
Names the source file that holds the command definition statements. The default is QCMDSRC.
*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
Library
Library
Suggested / special values:
*LIBL, *CURLIB
SRCMBR
Source member
Names the source member holding the command definition statements when SRCFILE is a database file.
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.
REXSRCFILE
REXX source file
Qualified parts (object, then library; write LIBRARY/OBJECT)
REXX source file
REXX source file
Library
Library
Suggested / special values:
*LIBL, *CURLIB
REXSRCMBR
REXX source member
Suggested / special values:
*CMD
REXCMDENV
REXX command environment
Qualified parts (object, then library; write LIBRARY/OBJECT)
REXX command environment
REXX command environment
Library
Library
Suggested / special values:
*LIBL, *CURLIB
REXEXITPGM
REXX exit programs
Elements in order
Program
Program
Qualified parts (object, then library; write LIBRARY/OBJECT)
Program
Program
Library
Library
Suggested / special values:
*LIBL, *CURLIB
Exit code
Exit code
THDSAFE
Threadsafe
Allowed values:
*NO, *YES, *COND
MLTTHDACN
Multithreaded job action
Allowed values:
*SYSVAL, *RUN, *MSG, *NORUN
TEXT
Text 'description'
Gives brief text describing the object, up to 50 bytes in apostrophes.
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
Allowed values:
*EVENTF, *NOEVENTF
VLDCKR
Validity checking program
Suggested / special values:
*NONE
Qualified parts (object, then library; write LIBRARY/OBJECT)
Validity checking program
Validity checking program
Library
Library
Suggested / special values:
*LIBL, *CURLIB
MODE
Mode in which valid
Allowed values:
*ALL, *PROD, *DEBUG, *SERVICE
ALLOW
Where allowed to run
Sets where the command can be processed.
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
Allowed values:
*NO, *YES
MAXPOS
Maximum positional parameters
Suggested / special values:
*NOMAX
PMTFILE
Message file for prompt text
Suggested / special values:
*NONE
Elements in order
Message file
Message file
Qualified parts (object, then library; write LIBRARY/OBJECT)
Message file
Message file
Library
Library
Suggested / special values:
*LIBL, *CURLIB
Message text
Message text
Allowed values:
*STATIC, *DYNAMIC
MSGF
Message file
Qualified parts (object, then library; write LIBRARY/OBJECT)
Message file
Message file
Library
Library
Suggested / special values:
*LIBL, *CURLIB
HLPSHELF
Help bookshelf
Suggested / special values:
*NONE, *LIST
HLPPNLGRP
Help panel group
Suggested / special values:
*NONE
Qualified parts (object, then library; write LIBRARY/OBJECT)
Help panel group
Help panel group
Library
Library
Suggested / special values:
*LIBL, *CURLIB
HLPID
Help identifier
Suggested / special values:
*NONE, *CMD
HLPSCHIDX
Help search index
Suggested / special values:
*NONE
Qualified parts (object, then library; write LIBRARY/OBJECT)
Help search index
Help search index
Library
Library
Suggested / special values:
*LIBL, *CURLIB
CURLIB
Current library
Suggested / special values:
*NOCHG, *CRTDFT
PRDLIB
Product library
Suggested / special values:
*NOCHG, *NONE
PMTOVRPGM
Prompt override program
Suggested / special values:
*NONE
Qualified parts (object, then library; write LIBRARY/OBJECT)
Prompt override program
Prompt override program
Library
Library
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.
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.
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
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.
Generated from os/cl/catalog/CRTCMD.json and os/cl/help/CRTCMD.json.