A CS_SERVERMSG (server message) structure contains information about an error or informational message returned by the server. This structure is defined within the application. ct_diag returns a message string and information about the message in this structure.
Client messages are returned to a CS_CLIENTMSG structure as described in “CS_CLIENTMSG structure”.
CS_CLIENTMSG and CS_SERVERMSG structures are part of the Mainframe ClientConnect (MCC) CTPUBLIC include file.
This structure contains information about all messages received by the client application, including MCC messages, messages returned by the remote transactions, and messages returned by the database, such as DB2 Access Module messages and Adaptive Server messages.
A CS_SERVERMSG structure is defined as follows:
typedef struct_cs_servermsg { CS_MSGNUM msgnumber; CS_INT state; CS_INT severity; CS_CHAR text[CS_MAX_MSG]; CS_INT textlen; CS_CHAR svrname[CS_MAX_MSG]; CS_INT svrnlen;
/* **RPC’s may be involved. If so, the **following have info in them.
*/
CS_CHAR proc[CS_MAX_MSG]; CS_INT proclen; CS_INT line; CS_INT status; } CS_SERVERMSG
msgnumber is the server message number. This field corresponds to the message_number argument of the Gateway-Library function tdsndmsg.
state is the message state. This field corresponds to the error_state argument of the Gateway-Library function tdsndmsg.
severity is a symbolic value representing the severity of the message. Severity values are provided in the CTPUBLIC include file. This field corresponds to the severity argument of the Gateway-Library function tdsndmsg.
Table 2-10 lists the legal values for severity.
Severity value |
Meaning |
---|---|
CS_SV_INFORM (0) |
No error occurred. The message is informational. |
CS_SV_API_FAIL (1) |
A Client-Library routine generated an error. This error is typically caused by a bad parameter or calling sequence. The server connection is probably salvageable. |
CS_SV_RETRY_FAIL (2) |
An operation failed, but it can be retried. |
CS_SV_RESOURCE_FAIL (3) |
A resource error occurred. This error is typically caused by an allocation error, a lack of file descriptors, or timeout error. The server connection is probably not salvageable. |
CS_SV_CONFIG_FAIL (4) |
A configuration error occurred. |
CS_SV_COMM_FAIL (5) |
An unrecoverable error in the server communication channel occurred. The server connection is not salvageable. |
CS_SV_INTERNAL_FAIL (6) |
An internal Client-Library error occurred. |
CS_SV_FATAL (7) |
A serious error occurred. All server connections are unusable. |
text is the text of the message string. This field corresponds to the message_text argument of the Gateway-Library function tdsndmsg.
textlen is the length, in bytes, of text. If there is no message text, the value of textlen is 0. This field corresponds to the message_length argument of the Gateway-Library function tdsndmsg.
svrname is the name of the server that generated the message. This is the server name from the Server Path Table.
The Server Path Table contains the information the Client-Library programs need to route requests to a remote server, including the name of the server and the connections that can be used to access that server. This table is part of the Connection Router, described in the Mainframe Connect Server Option Installation and Administration Guide.
svrnlen is the length, in bytes, of svrname.
proc is the name of the remote procedure or transaction that returned the message. That is, the name of the Adaptive Server stored procedure or the transaction ID of the mainframe transaction. This field corresponds to the transaction_id argument of the Gateway-Library function tdsndmsg.
proclen is the length, in bytes, of proc. This field corresponds to the transaction_id_length argument of the Gateway-Library function tdsndmsg.
line is the line number in the called procedure or transaction where the error occurred. It may also be used for miscellaneous information. This field corresponds to the line_id argument of the Gateway-Library function tdsndmsg.
status is reserved for future use.