cwbDT_ASCIIZonedToZoned

Purpose

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

Unicode version

None.

Syntax

 
unsigned int CWB_ENTRY cwbDT_ASCIIZonedToZoned(
                             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 left half of each byte (0x3) in the ASCII zoned decimal format will be converted to 0xf in the left half-byte of the EBCDIC zoned data except for the last byte (sign). This function checks that the left half of each byte in the ASCII zoned decimal data must be 0x3 except for the last byte. The high half of the last byte must be 0x3 or 0xb. The right half of each byte in the ASCII zoned decimal data must be in the range 0-9.