__le_msg_get() — Get a Language Environment message

Standards

Standards / Extensions C or C++ Dependencies

Language Environment

both AMODE 64

Format

#include <__le_api.h>

void  *__le_msg_get(_FEEDBACK * cond_token,
                    _CHAR80 message_area,
                    _INT4 * msg_index,
                    _FEEDBACK * fc);

General description

Retrieves, formats, and stores, in a passed message area, a Language Environment® message corresponding to a user supplied condition token. The caller can later retrieve the message to modify or to write as output.

Parameter
Description
cond_token
A 16–byte condition token supplied by the invoker.
message_area
A fixed-length 80 character string, where the message is placed.
Note: The message is left-justified and padded on the right with blanks.
msg_index
A 4–byte binary integer returned to the invoker.

The msg_index should be set to zero on the first invocation of __le_msg_get(). If a message is too large to be contained in the message_area, msg_index is returned as an index into the message. This index is used on subsequent invocations to retrieve the remaining portion of the message. Feedback Code is also returned, indicating the message has been truncated. When the entire message is returned, msg_index is zero.

msg_idex contains different results based on the length of the message.
  • If a message contains fewer than 80 characters, the entire message is returned on the first invocation. msg_index contains 0.
  • If a message contains exactly 80 characters, the entire message is returned on the first invocation. msg_index contains 0.
  • If the message is more than 80 characters it is split into segments. The msg_index does not contain the cumulative index for the entire message returned, but contains only the index of the segment that was just returned. It is up to the user to maintain the cumulative count if needed. When a message is too long, the following can occur:
    • If a message contains more than 80 characters and at least one blank is contained in the first 80 characters, the string up to and including the last blank is returned on the first invocation.
    • If the 80th character is non-blank (even if the 81st character is a blank), msg_index contains the index of the last blank (something less than 80), and the next invocation starts with the next character.
    • If the 80th character is a blank, msg_index contains 80 and the next invocation starts with the 81st character, blank or non-blank.
    • If a message contains more than 80 characters and at least the first 80 are all non-blank, the first 80 are returned. The next invocation does not add any blanks and starts with the 81st character. msg_index contains 80.
fc
A 16–byte Feedback Code indicating the results of this function.
Table 1. Feedback Codes for __le_msg_get()
Code Severity Message Number Message Text
CEE000 0 - - The function complete successfully.
CEE036 3 102 An unrecognized condition token was passed to the function and could not be used.
CEE0E2 3 450 The message inserts for the condition token with message number message-number and facility ID facility-id could not be located.
CEE0E6 3 454 The message number message-number could not be found for facility ID facility-id.
CEE0E7 1 455 The message with message number message-number and facility ID facility-id was truncated.
CEE0EA 1 458 The message repository repository-name could not be located.

Usage notes

  1. z/OS® UNIX System Services consideration – In multithreaded applications, __le_msg_get() affects only the invoking thread. However, __le_msg_get() uses the NATLANG value of the enclave. Any subsequent calls to __le_msg_get(), for a given condition, use the NATLANG value in effect at the time of the first invocation.

Related information