cwbDT_ZonedToASCII

Purpose

Translates EBCDIC zoned decimal data to ASCII numeric format. This function can be used for translating data from the iSeries™ server for use in ASCII text format.

Unicode version

cwbDT_ZonedToWide

Syntax

 
unsigned int CWB_ENTRY cwbDT_ZonedToASCII(                       
                             char         *target,
                             char         *source,
                             unsigned long length,
                             unsigned long decimalPosition);

Parameters

char * target - output
Pointer to the target data.
char * source - input
Pointer to the source data.
unsigned long length - input
Number of bytes of source data to translate.
unsigned long decimalPosition - input
Position of the decimal point.

Return Codes

The following list shows common return values.

CWB_OK
Successful Completion.
CWB_INVALID_POINTER
NULL pointer was passed by caller.
CWB_BUFFER_OVERFLOW
Overflow error.
other
Offset of the first untranslated character plus one.

Usage

The caller must make sure that there is adequate space to hold the target information. The high half of the last byte of the zoned data indicates the sign of the number. If the high half-byte is 0xb or 0xd, then a negative number is indicated. Any other value indicates a positive number. This function checks that the high half of each byte of zoned data must be 0xf except for the last byte. The low half of each byte of zoned data must be in the range 0-9. 0 <= decimalPosition < length.