Retrieve Message (QMHRTVM) API


  Required Parameter Group:


  Optional Parameter Group:


  Default Public Authority: *USE

  Threadsafe: Yes

The Retrieve Message (QMHRTVM) API retrieves the message description of a predefined message. The message description is created with the Add Message Description (ADDMSGD) command. It consists of the text of the message and other information, such as the message help and the default reply for the message. You can use the QMHRTVM API to copy the text of predefined messages into a program.

Retrieving a message is not the same as receiving a message. Retrieving a message with this API returns the message and associated information stored in the message file. In contrast, receiving a message with the Receive Nonprogram Message (QMHRCVM) or Receive Program Message (QMHRCVPM) API focuses on the message as it is sent to a particular user or program at a particular time. The information returned from the QMHRCVM or the QMHRCVPM API includes details about who sent the message, when it was sent, why it was sent, and so on.


Authorities and Locks

Message File Authority
*USE
Message File Library Authority
*EXECUTE

Required Parameter Group

Message information
OUTPUT; CHAR(*)

The variable that receives information returned, in the format specified in the format name parameter, of the length specified in the length of message information parameter. If the user is retrieving the next message of the last message of a message file or the first message of an empty message file, blanks are returned for the message information field.

Length of message information
INPUT; BINARY(4)

The size of the area to contain the message information, in bytes. The minimum size is 8.

This parameter must specify the size of the variable you use for the message information parameter. If this parameter specifies a longer size, other parts of storage could be overwritten when the API returns the information.

The API returns as much information as it can fit in this length. If the available message information is longer, it is truncated. If the available message information is shorter, the unused output area is unchanged; whatever is already stored in that space remains there.

To determine how much information the API actually returns in response to this call, see the bytes returned field in the message information format. To determine how much information the API could return if space were available, see the bytes available field.

Format name
INPUT; CHAR(8)

The format to use for the message information. Specify one of these format names:


Message identifier
INPUT; CHAR(7)

The identifying code for the predefined message being retrieved. If the retrieve option parameter is *FIRST, this field is ignored and the first alphabetical message is retrieved from the message file.

Qualified message file name
INPUT; CHAR(20)

The name of the message file from which to retrieve the message information and the library in which it resides. The first 10 characters specify the file name; thesecond 10 characters specify the library. You can use these special values for the library name:


Replacement data
INPUT; CHAR(*)

The values to insert in the substitution variables in the predefined message and message help.

If you use blanks for this parameter, blanks are inserted for the substitution variables.

If this parameter contains pointer data, each pointer must start on a 16-byte boundary to keep the data accurate.

Length of replacement data
INPUT;BINARY(4)

The length of the replacement data parameter, in bytes. Valid values are 0 through 32767.

Replace substitution variables
INPUT; CHAR(10)

Whether to replace the substitution variables with the values given in the replacement data parameter. Specify one of these values:


Return format control characters
INPUT; CHAR(10)

Whether or not the format control characters are returned in the message help output field. Specify one of these values:

Three format control characters can be returned within the message. They are defined in the online help of the Add Message Description (ADDMSGD) command to have these meanings:


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

Retrieve option
INPUT; CHAR(10)

If this parameter is not used, it is defaulted to *MSGID. The following options are allowed:

Note: Although the last 4 characters of a message identifier can be thought of as 4 hexadecimal numbers, the values 'A' through 'F' are treated as characters when sorting. For example, CPFAAAA is listed before CPF0001.

CCSID to convert to
INPUT; BINARY(4)

The coded character set identifier (CCSID) in which you want your message text returned. This only applies to text returned in the message and message help fields. The following values are allowed:

Note: If the text contains substitution variables, only the substitution variables that are *CCHAR type data are converted to this CCSID. All other message data is not converted before being returned.

CCSID of replacement data
INPUT; BINARY(4)

The coded character set identifier (CCSID) that the supplied replacement data is in. This only applies to parts of the replacement data that are defined as *CCHAR. The *CCHAR data is converted from this CCSID to the CCSID in which you want all your text converted. The following values are allowed:


RTVM0100 Format

The following table lists the fields in the RTVM0100 format. For more information about each field, see Field Descriptions.



RTVM0200 Format

The following table lists the fields in the RTVM0200 format. For more information about each field, see Field Descriptions.



RTVM0300 Format

The following table lists the fields in the RTVM0300 format. For more information about each field, see Field Descriptions.



RTVM0400 Format

The following table lists the fields in the RTVM0400 format. For more information about each field, see Field Descriptions.



Relational Test Entry Format

The following table lists the fields in the Relational Test Entry format. For more information about each field, see Field Descriptions.



Special Reply Value Entry Format

The following table lists the fields in the Special Reply Value Entry format. For more information about each field, see Field Descriptions.



Substitution Variable Format

The following table lists the fields in the Substitution Variable format. For more information about each field,see Field Descriptions.



Valid Reply Entry Format

The following table lists the fields in the Valid Reply Entry format. For more information about each field, see Field Descriptions.



Field Descriptions

This section describes the fields returned in further detail. The fields are listed in alphabetical order.

Alert index. The format number for the message data field. This number is also called the resource name variable. For more information, see the Alerts Support Link to PDF manual.

Alert option. Whether and when an SNA alert is created and sent for the message. Valid values follow:

For more information, see the Alerts Support manual.

Bytes available. The length of all available information about the format. Bytes available can be greater than the length specified in the APIs length of message information parameter. If it is greater, the information returned is truncated.

Bytes returned. The length of all information returned in the format. The value of the bytes returned field is always less than or equal to the value of the length of message information parameter, and less than or equal to the bytes available. If the bytes returned value is less than the length of message information value, the unused space is unchanged.

CCSID conversion status indicator of replacement data. This value indicates the status of any CCSID conversion that may have occurred when inserting the replacement data into the message description. The following values may be returned:

CCSID conversion status indicator of text. This value indicates the status of any CCSID conversion that may have occurred when retrieving the message description from the message file. The following values may be returned:

CCSID of text returned. The coded character set identifier in which the text of the message description is returned.

Note: If a conversion error occurs or if the CCSID you requested the text to be converted to is 65535, the CCSID that the message description is stored in is returned. Otherwise the CCSID you wanted your text converted to is returned. If you do not want the text converted before it is returned but you do want to know the CCSID that the message description is stored in, specify 65535 on the coded character set identifier to convert to parameter. The CCSID the message description is stored in is returned in the coded character set identifier or text returned field.

The CCSID returned in the coded character set identifier for text returned may not apply to the replacement data substituted in the text returned. Only the *CCHAR substitution variables are converted to the CCSID specified. The rest of the replacement data is not converted before it is returned. Also, if an error occurred trying to convert the replacement data from the CCSID of the message data to the CCSID to convert to, the replacement data would not be converted before it is returned.

Default program library name. The library specified for the default program. This can be the actual library name, *LIBL, or *CURLIB.

Default program name. The name of the program called to take default action if this message is sent as an escape message to a program or procedure that is not monitoring for it.

Default reply. The default reply for the message identifier retrieved.

Dump list entry. Each dump list entry is a BINARY(4) value that specifies data to be dumped when the message is sent as an escape message to a program that is not monitoring for it. The following values may be returned:

Field size or decimal positions. This value is used in one of two ways, depending on the substitution variable type.

From-value. The from-value in a special reply value entry. This is a value that can be entered as a reply to the message even though it may not meet the other reply validity checking specifications. It will be accepted and converted to a valid response specified in the to-value.

Length (general information about the following length fields). These formats use two types of length fields, each related to a single variable length text field. (The variable length text fields return information to the caller.) The first type of length field is returned length; the second is available length. Returned length is the actual length of the text in the variable length text field. Available length is the length of the text before it is placed in the variable length text field. It is always greater than or equal to the returned length. If the available length equals the returned length, all the message information is returned. If the text is truncated when placed in the variable length field, the available length is greater than the returned length by the number of characters truncated.

Length of default reply available. The length of the available default reply, in bytes.

Length of default reply returned. The length of the returned default reply, in bytes.

Length of dump list entries available. The length of the available dump list entries, in bytes.

Length of dump list entries returned. The length of the available dump list entries that were actually returned, in bytes.

Length of lower range reply value available. The length of the available lower range reply value, in bytes.

Length of lower range reply value returned. The length of the returned lower range reply value, in bytes.

Length of message available. The length of the available message text, in bytes.

Length of message help available. The length of the available help information for the message, in bytes.

Length of message help returned. The length of the returned help information for the message, in bytes.

Length of message returned. The length of the returned message text, in bytes.

Length of relational test entry available. The length of the available relational test entry, in bytes.

Length of relational test entry returned. The length of the returned relational test entry, in bytes.

Length of relational value. The length of the value to be compared to the reply entered for a relational test entry, in bytes.

Length of replacement data for substitution variable. The number of characters or digits that are needed in the message replacement data for this substitution variable. The value returned is dependant on the substitution variable type and length:

Length of special reply value entriesavailable. The total length in bytes of all the available special reply value entries.

Length of special reply value entries returned. The length in bytes of the special reply value entries that were actually returned.

Length of special reply value entry. The length of the special reply value entry, in bytes.

Length of substitution variable format element. The length in bytes of each substitution variable format element.

Length of substitution variable formats available. The total length in bytes of all the available substitution variable formats.

Length of substitution variable formats returned. The length in bytes of the substitution variable formats that were actually returned.

Length of upper range reply value available. The length of the available upper range reply value, in bytes.

Length of upper range reply value returned. The length of the returned upper range reply value, in bytes.

Length of valid reply value entries available. The total length in bytes of all the available valid reply value entries.

Length of valid reply value entries returned. The length in bytes of the valid reply value entries that were actually returned.

Length of valid reply value entry. The length of the valid reply value entry, in bytes.

Log indicator. The log problem indicator for the message retrieved. Possible values follow:

Lower range reply value. The lower value limit for the valid reply.

Maximum reply decimal positions. The maximum number of decimal positions allowed in the message reply.

Maximum reply length. The maximum length of a reply to an inquiry or notify message.

Message. The text of the message retrieved.

Message creation date. The date this the message was created, in CYYMMDD format.

Message creation level number. The level number of this message. This will be a value from 1 to 99.

Message help. The message help for the message retrieved.

Message ID. The message ID of the message retrieved.

Message modification date. The date this message was modified, in CYYMMDD format.

Message modification level number. The modification level number of this message. This will be a value from 1 to 99.

Message severity. The severity of the message retrieved.

Number of dump list entries returned. The number of dump list entries that were returned in the message information format. The dump list entry field is repeated once for each dump list entry.

Number of special reply values returned. The number of special reply values that were returned in the message information format. The special reply value entry field structure is repeated once for each special reply value.

Number of substitution variable formats. The number of substitution variables in the message description. The substitution variable formats field structure is repeated once for each substitution variable in the message.

Number of valid reply values returned. The number of valid reply values that were returned in the message information format. The valid reply value entry field structure is repeated once for each valid reply value.

Offset of default reply. The offset of the default reply, in bytes.

Offset of dump list entries. The offset of the dump list entries, in bytes.

Offset of lower range reply value. The offset of the lower range reply value, in bytes.

Offset of message. The offset of the first-level message, in bytes.

Offset of message help. The offset of the second-level message, in bytes.

Offset of relational test entry. The offset of the relational test entry, in bytes.

Offset of special reply value entries. The offset of the special reply value entries, in bytes.

Offset of substitution variable formats. The offset in bytes to the substitution variable formats.

Offset of upper range reply value. The offset of the upper range reply value, in bytes.

Offset of valid reply value entries. The offset of the valid reply value entries, in bytes.

Relational operator. The relational operator for a relational test entry. This value is one of the following:

Relational test entry. The relational test for the reply value that is defined in the message description. For more information, see Relational Test Entry Format.

Relational value. The value to be compared to the reply entered for a relational test entry.

Reply type. The type of valid values that can be made to an inquiry or notify message. One of the following values will be returned:

Reserved. An ignored field.

Special reply value entries. Each special reply value that is defined in the message description is returned in a special reply value entry. For more information, see Special Reply Value Entry Format.

Stored CCSID of message. The CCSID that was specified for the message. For messages created on a release prior to V3R1 the value 65535 will be returned.

Substitution variable formats. Each substitution variable that is defined in the message description is returned in a substitution variable format. For more information, see Substitution Variable Format.

Substitution variable type. The type of data the substitution variable contains and how the data is formatted when substituted into the returned message text. The value is one of the following types:

To-value. The to-value in a special reply value entry. This is the value that will be used as the reply value when the value entered matches the from-value.

Upper range reply value. The upper value limit for the valid reply.

Valid reply entries. Each valid reply value that is defined in the message description is returned in a valid reply value entry. For more information, see Valid Reply Entry Format.

Valid reply value. The valid reply value in a valid reply value entry.


Error Messages



API introduced: V2R1.1

[ Back to top | Message Handling APIs | APIs by category ]