Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
The iQuery.RTVCMDD() UDTF returns a one row result that contains the attributes used to create the specified CL Command.
iQuery.RTVCMDD( library-name, command-name, follow-proxy )
The Library-name parameter is the name of the library that contains the command definition object. The special values *CURLIB and *LIBL are supported along with any library name.
The Command-name parameter is the name of the command whose description is retrieved.
The optional follow-proxy parameter indicates that if the command is a proxy command, the description of the actual command should be returned. Valid options are 0 (do not follow proxy) and 1 (follow proxy to original command) The default is 1.
Column | Type | Description |
CMDNAME | varchar(10) | The name of the CL Command whose attributes have been returned. |
CMDLIB | varchar(10) | The library in which the CL Command is located. |
PGMNAME | varchar(10) | The Command Processing Program (CPP) that is run by this command. |
PGMLIB | varchar(10) | The Library name used to located the Command Programming Program. |
SRCFILE | varchar(10) | The source file that contains the Command Definition Source. |
SRCLIB | varchar(10) | The library that contains the source file of the Command Definition Source. |
SRCMBR | varchar(10) | The source member that was used to create the command definition. |
VLDCHK_PGMNAME | varchar(10) | The name of the validity checking program (if any) associated with the Command Definition. |
VLDCHK_PGMLIB | varchar(10) | The library that is used to locate the Validity Checking Program. |
RUNTIME_MODE | varchar(10) | The operating environment in which the command may run *DEBUG, *PROD, *SERVICE. This is a 10-byte field that contains mode flags as 1-byte indicators. '1' = true, '0'=false. Position 1 = Production Mode, 2 = Debug Mode, 3 = Service Mode, bytes 4 to 10 a reserved and always 0. |
ALWLMTUSR | char(1) | Allow Limited Users to use this Command. 0=Do not allow, 1=Allow limited user access. |
MAXPARMS | int | The number of positional (none-keyword qualified) parameters that are allowed. -1 = ALL, 1 to 75 = positional parameter limit. |
PROMPT_MSGFILE | varchar(10) | The message file used for this command's text during prompting. |
PROMPT_MSGLIB | varchar(10) | The library used to locate the message file for prompting. |
MSGFILE | varchar(10) | Error Message file used by the DEP statements within this Command. |
MSGLIB | varchar(10) | The library used to locate the message file used by DEP statements. |
HELPPNLNAME | varchar(10) | The name of the online help text object (Panel Group) used for help text for this Command. |
HELPPNLLIB | varchar(10) | The library used to locate the Help Text Panel Group. |
SCHINDEX | varchar(10) | The help text search index. This value is typically *NONE |
SCHINDEX_Lib | varchar(10) | The library used to locate the help text search index object. |
CURLIB | varchar(10) | When the CL command is run, this library is set and the job's current library while the command is running. In addition to any library name, this value may also contain *CRTDFT (which usually means QGPL) or *NOCHG which means no current library change is made. |
PRDLIB | varchar(10) | When the CL commadn is run, this library is set as one of the 2 Product libraries and is removed when the command ends. |
PMTOVR_PGMNAME | varchar(10) | The name of the Prompt Override Program used when prompting the CL command to change the list of values permited for a parameter and other runtime changes. |
PMTOVR_PGMLIB | varchar(10) | The library used to locate the Prompt Override Program. |
TGTRLS | varchar(6) | The Target Release used when creating the command. The format is VxRyMz |
CMDTEXT | varchar(50) | The text description for the command definition object. |
CRTCCSID | int | The CCSID of the command when it was created. |
PGM_STATE | varchar(2) | The state *S = System State, and *U = User State for the Command Processing Program. |
VLDCHK_STATE | varchar(2) | The state *S = System State, and *U = User State for the Validity Checking Program. |
PMTOVR_STATE | varchar(2) | The state *S = System State, and *U = User State for the Prompt Override Program. |
ENABLE_GUI | char(1) | Whether or not the Command Prompt is enabled for ENPTUI or "GUI" controls. 1=Enabled, 0=Disabled |
MTHREADED_ACTION | char(1) | What to do when the job is multithreaded. '0'=Use the action specified in QMLTTHDACN system value. '1'=Run the command. Send no message. '2'=Run the command and send and *INFO message. '3'=Do not the command and send and *ESCAPE message. |
ISPROXYCMD | char(1) | A proxy command is similar to an alias or shortcut to the command. It is affectdively a logical view of the command in another library and optionally with another name. If "this" command is a Proxy Command, this field contains '1', otherwise it contains '0'. |
RUNTIME_PROMPT_MSGTEXT | char(1) | This flag indicates if the CL command should use a runtime library list search for the prompt message text used by the Commadn parameters. '1'=Use runtime search, '0'=Compile-time embedding of prompt text. As of Power 7 systems, IBM switched all IBM-supplied CL Commands to '1'. As of that moment, there is no perceptible difference in prompt speeds and no reason to ever have this set to zero. |
ALLOW | varchar(80) | The program environment in which the command may run. This corresponds to the ALLOW parameter of the CRTCMD command and the parameter of the CMD statement in the Command Definition source code. |
ERRMSGID | varchar(7) | If an error is generated while retrieving the Command Definition, that CPF message ID is copied to this column for simplified diagnostics. |
The following example returns the command processing program name and library and the source file and member for the command named RUNIQRY.
select pgmname,pgmlib,srcfile,srclib,srcmbr
INTO :cppName, :cppLib, :crtSrc, :crtSLib, :crtMbr
from table( iQuery.RTVCMDD('IQUERY','RUNIQRY') ) cmd;