Midrange News for the IBM i Community


Posted by: Bob Cozzi
Rogue Programmer
Cozzi Productions, Inc.
Chicagoland
SQL iQuery Documentation - UDF and UDTF
has no ratings.
Published: 20 Jun 2019
Revised: 20 Jun 2019 - 487 days ago
Last viewed on: 18 Oct 2020 (257 views) 
  1. SQL iQuery - RUNiQRY CL Command
  2. CSV() - Read and Parse Comma Separated Values File
  3. CSV_VAL() Extract CSV Column Value
  4. CSV_XXXX() Extract CSV Column Value as xxxx
  5. CSV_COUNT - Retrieve Field Count
  6. ObjExist - Check Object Exits
  7. DTAARA - Data Area
  8. encode_URL Encode URL for the Web
  9. encode_TAG Encode HTML TAG Content
  10. FLDLIST - List the Fields of a Table
  11. FROMHEX - Fold 2-hex Chars into 1 Char
  12. GET CPUCNT, CURLIB, ENV, SRLNBR, SYSNAME
  13. MD5_HASH - UDF - Return MD5 Hash
  14. ifsStat - Get IFS File Attributes
  15. ifsExists - Check if IFS File Exists
  16. ifsFile - Query Contents of IFS Text File
  17. ifsDIR - List IFS Directory Entires
  18. DEPFILE - List Dependent Database Relations
  19. JOB - Get Job Name Component
  20. Job_ATTR - Job Attributes
  21. JOB_DATE Retrieve the Job Date
  22. JOBLOG - Write Message to Joblog
  23. Library List UDF and Procedures
  24. MBRLIST - Member List
  25. MCHINFO Machine Type and Model Number and OS version
  26. OSVER and OSVRM Get IBM i Version/Release
  27. PrintPDF - Print a PDF to a PDF Compatible Printer
  28. CPYTOPDF - Copy SPOOLED File to PDF file
  29. OBJ_LIST List Object in a Library
  30. LIB_LIST List Descriptions of Libraries on the Library List
  31. OBJ_EXPORTS List Exported Items from an Object
  32. OBJ_STRUCT Retrieve Objects Components
  33. RTVCMDD Retrieve Command Definition
  34. RTVJOBA - Retrieve Job Attributes
  35. RTVJOBD - Retrieve Job Description
  36. RTVLASTSPLF - Retrieve ID of Last SPOOLED File for this Job
  37. RTVxxx - Retrieve Various Objects Description Table Functions
  38. WATCHLIST - List Current Watches
  39. Polymorphic Qualified Name Syntax

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.

iQuery.RTVCMDD - UDTF Published by: Bob Cozzi on 20 Jun 2019 view comments

Retrieve Command Description

The iQuery.RTVCMDD() UDTF returns a one row result that contains the attributes used to create the specified CL Command.

Parameters

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.

Result Set Columns

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.

Example

select pgmname,pgmlib,srcfile,srclib,srcmbr 
INTO :cppName, :cppLib, :crtSrc, :crtSLib, :crtMbr
from table( iQuery.RTVCMDD('IQUERY','RUNIQRY') ) cmd;
  • CPPNAME = RUNIQRY
  • CPPLIB = IQUERY
  • CRTSRC = QCMDSRC
  • CRTSLIB = COZTOOLS
  • CRTMBR = RUNIQRY

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS