Retrieve Command Information (QCDRCMDI) API


  Required Parameter Group:


  Optional Parameter:


  Default Public Authority: *USE

  Threadsafe: Yes

The Retrieve Command Information (QCDRCMDI) API retrieves information from a command definition object and places it into a single variable in the calling program. The amount of information returned depends on the size of the variable. The information returned is the same information returned by the Display Command (DSPCMD) command.

You can use the QCDRCMDI API to retrieve any operable command. This includes both interactive (such as Display Program (DSPPGM) and Create Library (CRTLIB)) and non-interactive (such as DO, IF, and ELSE) commands. It does not include command definition statements that appear in command source, such as CMD, DEP, ELEM, PARM, PMTCTL, and QUAL.

Authorities and Locks

Command Definition Object Authority
*USE
Library Authority
*EXECUTE
Command Definition Object Lock
*SHRRD

Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The variable that is to receive the information requested. The minimum size for this area is 8 bytes. You can specify the size of this area to be smaller than the format requested as long as you specify the length parameter correctly. As a result, the API returns only the data that the area can hold.

Length of receiver variable
INPUT; BINARY(4)

The length of the receiver variable. If this value is larger than the actual size of the receiver variable, the result may not be predictable. The minimum length is 8 bytes.

Format name
INPUT; CHAR(8)

The format of the command information to be returned. One of the following format names may be used:


Qualified command name
INPUT; CHAR(20)

The name of the command whose values are to be retrieved. The first 10 characters contain the name of the command. The second 10 characters contain the name of the library where the command is located.

You can use these special values for the library name:


Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Optional Parameter Group

Follow proxy chain
INPUT; CHAR(1)

If the specified command is a proxy command, indicates whether the proxy command chain should be followed or not. If this parameter is omitted, a value of '0' is assumed.

The valid values are as follows:

CMDI0100 Format

The following table describes the information that is returned in the receiver variable for the CMDI0100 format. For detailed descriptions of the fields, see Field Descriptions.



CMDI0200 Format

The following table describes the information that is returned in the receiver variable for the CMDI0200 format. For detailed descriptions of the fields, see Field Descriptions.



Field Descriptions

For more information about the following fields, see the documentation for the Create Command (CRTCMD) command in the online help.

Allow limited user. Whether or not a user with limited authorities is allowed to run this command. The possible values are 0 (*NO) or 1 (*YES).

Bytes available. The length of all data available for the requested format. All available data is returned if enough space is provided.

Bytes returned. The length of all data actually returned. If the data is truncated because the receiver variable is not large enough to hold the data, this value is less than the bytes available.

Coded character set ID (CCSID). The value of the coded character set ID associated with this command. It is the value of the job coded character set ID when this command was created.

Command library name. The name of the library in which the command description resides.

Command name. The name of the command description about which information is being returned.

Command processing program call state. The state the command processing program is called from. The possible values are:

Command processing program's or proxy target command's library name. The name of the library in which the command processing program or proxy target command resides. This field is blank if the command processing program name contains the special value *REXX.

Command processing program name or proxy target command name. The name of the program or target command that accepts parameters from the command and processes the command. Consult the proxy command indicator to determine if the value is a program or command name. The possible values are:

Current library. The name of the library used as the current library during the processing of this command. The possible values are:

Enabled for GUI indicator. Whether the command prompt panels are enabled for conversion to a graphical user interface. The possible values are:

Help identifier. The name of the general help module for the names of the help identifiers for this command. The possible values are:

Help panel group library name. The name of the library in which the panel group resides.

Help panel group name. The name of the panel group in which the online help information exists for this command. If *NONE is returned, no help panel group is defined for this command.

Length of a REXX exit entry. The length of one REXX exit entry. This value is currently 24. There are 10 bytes for the REXX exit program name, 10 bytes for the REXX exit library name, and 4 bytes for the REXX exit code.

Length of help bookshelf information. This value will always be zero.

Maximum positional parameters. The maximum number of parameters than can be coded in a positional manner for this command. The possible values are:

Message file library name. The name of the library in which the message file resides.

Message file name. The message file from which messages identified on the DEP statements used to define the command are retrieved.

Mode information. The mode of operating environment to which the command applies. The characters of this field are as follows, and they can have a value of 0 (does not apply) or 1 (does apply):

Multithreaded job action. The action to take when a command that is not threadsafe is called in a multithreaded job. The possible values are:

If the threadsafe indicator is either threadsafe or conditionally threadsafe, the multithreaded job action value will be returned as 1.

Number of REXX exit entries. The number of times the REXX exit entries are repeated. These fields are REXX exit program name, REXX exit program library name, and REXX exit code.

Offset to help bookshelf information. This value will always be zero.

Product library. The name of the product library that is in effect during the processing of the command. The possible values are:

Prompt message file library name. The name of the library in which the prompt message file resides.

Prompt message file name. The name of the message file that contains the prompt text for this command. If *NONE is returned, no message file was specified for prompt text.

Prompt message file text indicator. Whether text messages used by the command are retrieved from the prompt message file when the command is prompted. The possible values are:

Prompt override program call state. The state the prompt override program is called from. The possible values are:

Prompt override program name. This is the name of the prompt override program that replaces default values (on the prompt display) with the current actual values for the parameter. If *NONE is returned, no prompt override program was specified for this command.

Proxy command indicator. Whether the command processing program name and command processing program library name fields contain program or command information. The possible values are:

Reserved. An ignored field.

Restricted to target release. The version, release, and modification level to which this command is restricted. If this field is blank, the command can be used in the current release. This applies only to a command used in a CL program. It must match the contents of the target release parameter on the Create CL Program (CRTCLPGM) command. See the CRTCLPGM command for more information. This field has the format VvRrMm, where:

REXX command environment library name. The name of the library in which the REXX command environment program resides.

REXX command environment name. The command environment program that is active when the REXX CPP starts to run. The REXX interpreter calls this program to process commands encountered in the REXX procedure. The possible values are:

REXX exit code. A value which controls the conditions in which the REXX exit program is called. The possible values are:

REXX exit program library name. The name of the library in which the REXX exit program resides.

REXX exit program name. The exit program used when the REXX interpreter is started under the conditions specified by the REXX exit code for this program.

REXX source file library name. The name of the library in which the REXX source file resides.

REXX source file member name. The name of the source file member that contains the REXX procedure that is the command processing program.

REXX source file name. The name of the source file that contains the REXX procedure that is the command processing program. The possible values are:

Search index library name. The name of the library in which the help search index resides.

Search index name. The name of the search index for this command. The possible values are:

Source file library name. The name of the library in which the source file resides.

Source file member name. The name of the source file member that contains the command definition statements used to create the command.

Source file name. The name of the source file that contains the source file member used to create the command.

Text description. The user text, if any, used to briefly describe the command and its function.

Threadsafe indicator. Whether the command can be used safely in a multithreaded job. The possible values are:

Validity check program call state. The state the validity check program is called from. The possible values are:

Validity check program library name. The name of the library in which the validity check program resides.

Validity check program name. The name of a program that performs additional user-defined validity checking on the parameters in the command. If *NONE is returned, no separate user-defined validity checking is done for this command. All validity checking is done by the command analyzer and the command processing program.

Where allowed to run. The environments in which this command is allowed to run. The characters of this field are as follows, and they can have a value of 0 (does not apply) or 1 (does apply):

Start of change End of change

Error Messages



API introduced: V2R2

[ Back to top | Program and CL Command APIs | APIs by category ]