cwbDT_ZonedToZoned

Purpose

Translates data from zoned decimal format to zoned decimal. This function can be used for translating data from the iSeries™ server for use in no-conversion files and vice-versa.

Unicode version

None.

Syntax

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

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.

Return Codes

The following list shows common return values.

CWB_OK
Successful Completion.
CWB_INVALID_POINTER
NULL pointer was passed by caller.
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 0xb then a 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.