Schema IQUERY
IndexRTVMSGD( LIBRARY_NAME => '*LIBL',
MSGF => 'message-file-name',
MSGID => '*FIRST' | 'msgid',
MSGID_CTL => '*MSGID' | '*NEXT' | '*GE' )
RTVMSGID( MSGID => '*FIRST' | 'msgid',
MSGF => 'message-file-name',
LIBRARY_NAME => '*LIBL',
MSGID_CTL => '*MSGID' | '*NEXT' | '*GE' )
The Retrieve Message Description (RTVMSGD) User Defined Table Function returns one row containing the Message ID, severity, and the 1st and 2nd level message text.
The Retrieve Message ID (RTVMSGID) UDTF is functionally the same
as the RTVMSGD UDTF except the parameter list is different. They
can be used interchangeably but RTVMSGID calls RTVMSGD to retrieve
the MSG info.
The MSGID parameter along with the optional MSGID_CTL parameter
controls which message ID's information is returned.
The RTVMSGD UDTF provide an alternative to using the QMHRTVM
API but does not provide the extensive results of that API
since that info is rarely needed in production application
development. Use this UDTF to dynamically retrieve the 1st level
message text for a message ID, quickly. For example, to retrieve
the message text for CPF2101 using the RTVMSGID UDTF::
SELECT MSG_TEXT FROM TABLE(RTVMSGID('CPF2101')) msg;
dcl-s msgText varchar(132);These examples retrieve message ID CPF21B5 from the QCPFMSG message file. The first one stores the resulting 1st level message text into the MSGTEXT RPG variable. The 2nd statement does the same thing but also returns the Message Serverity in the SEVERITY RPG variable.
dcl-s severity int(10);
exec SQL select msg_text INTO :msgText
FROM TABLE( iQuery.RTVMSGD( msgf=>'QCPFMSG', msgid=>'CPF21B5')) msg;
exec SQL Select msg_text,severity INTO :msgText, :severity
FROM TABLE( iQuery.RTVMSGID( 'CPF21B5') ) msg;
Column | Data Type | Description |
MSGF_LIB |
VARCHAR(10) |
The name of the library where the MSGF
(message file) is located. If *LIBL or *CURLIB is used on
the LIBRARY_NAME parameter or if LIBRARY_NAME is omitted,
this column will receive the library name where the message
file was located by the UDTF. |
MSGF |
VARCHAR(10) | The name of the message file. |
MSGID |
CHAR(7) | The message ID being returned. This will
match the MSGID input parameter unless *NEXT or *GE are
specified for MSGID_CTL |
SEVERITY |
integer |
The severity code of the message. Message
severity is from 0 to 99. |
MSG_TEXT | VARCHAR(132) | The first-level message text for the message ID. Up to 132 characters are returned. CCSID 1200 is used, but it should map into CCSID EBCDIC 37 just fine. |
SECLVL_TEXT |
VARCHAR(3000) |
The second level message text for the message
file. Up to 3000 characters are returned. CCSID 1200
is used, but it should map into CCSID EBCDIC 37 just fine. |