CNMC2T (CNMCODE2TXT): Code point translation

You can use NetView® with a problem-management database to open problem records when NetView alerts are received. The code point translation service routine is provided in PL/I and C to translate the numeric code points, received in the alert, into readable text.

Note:
This function is not supported when NetView is in a distributed system configuration.

The CNMC2T service routine provides translation for various types of code points to multicultural text.

The CNMC2T routine syntax follows:

PL/I CALL FORMAT:

CALL CNMC2T(hlbptr,trdata,trdatlen,trtable,trcode)

PL/I MACRO FORMAT:

CNMCODE2TXT DATA(trdata) LENG(trdatlen) TABLE(trtable) CODE(trcode)

C INVOCATION:

void Cnmc2t(void *trdata, int trdatlen, char *trtable, int trcode)

Where:

hlbptr
A 4-byte pointer field containing the address of the HLB control block.
trcode
A 4-byte integer field containing the code point to be translated.
trdata
A varying length character field to which the code point text is to be returned.
trdatlen
A 4-byte integer field containing the length of trdata. This is the maximum length of the area provided to receive the returned text.

If the value specified by trdatlen is less than the length of the text to be returned, the truncated text is returned in trdata and a return code of CNM_DATA_TRUNC is generated. The full length of the text that was truncated is stored in HLBLENG (Hlbleng).

If the value specified by trdatlen is equal to or greater than the length of the text to be returned, and HLBRC (Hlbrc) = CNM_GOOD, the length of the returned text is stored in HLBLENG (Hlbleng).

If the value specified by trdatlen is greater than the length of the receiving data buffer (trdata), a storage overlay can occur. Take special care when deciding the value of trdatlen.

trtable
An 8-byte character field that specifies the table to be used in translating the code point. Valid table names are:
SNAALERT
SNA alert description code point
SNACAUSE
SNA probable cause
SNADDATA
SNA detailed data
SNADDAT5
SNA detailed data code point, subfield X'85'
SNADDAT6
SNA detailed data code point, subfield X'86'
SNAFCAUS
SNA failure cause
SNAICAUS
SNA install cause
SNAREACT
SNA recovery actions
SNAUCAUS
SNA user cause

Return Codes:

Return Code Name Value Description
CNM_GOOD   0 Everything is OK.
CNM_NOT_FOUND  20 Table not found.
CNM_DATA_TRUNC  40 Data truncated; trdatlen is too small.
CNM_BAD_ADDR 160 Address of trdata is not valid.
CNM_BAD_TABLE 312 Incorrect table name.
CNM_BAD_CODE 316 Code point not found; length of trdata is 0.