Returns the message substitution data for the message identified by the index provided. This message attribute only pertains to messages returned from the iSeries™ server. The substitution data is the data inserted into the substitution variable fields defined for the message.
unsigned int CWB_ENTRY cwbSV_GetErrSubstTextIndexed( cwbSV_ErrHandle errorHandle, unsigned long index, char *substitutionData, unsigned long substitutionDataLength, unsigned long *returnLength);
The following list shows common return values.
iSeries server messages may be added to the error handle when using the cwbRC_CallPgm() and cwbRC_RunCmd() API's. In these cases, you can use this API to retrieve the substitution data for the iSeries server messages contained in the error handle. If there is no substitution data for the message, return code CWBSV_ATTRIBUTE_NOT_SET will be returned. An index value of 1 works with the lowest-level (i.e. oldest) message in the error handle. An index value equal to the count returned by the cwbSV_GetErrCount() API works with the top-level (i.e. most recent) message in the error handle. Index values less than 1 act as if 1 was passed in. Index values greater than the number of messages contained in the error handle act as if the returned count value from the cwbSV_GetErrCount() API was passed in. Use the returnLength parameter to determine the actual number of bytes returned in the substitution data when the return code is CWB_OK. The substitution data returned on this API could be used on a subsequent host retrieve message API call (QSYS/QMHRTVM) to retrieve the format of the substitution data or to return secondary help text with the substitution data added in. Host API's are called using the cwbRC_CallPgm() API.