cwbDT_PackedToASCII

Purpose

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

Unicode version

cwbDT_PackedToWide

Syntax

 
unsigned int CWB_ENTRY cwbDT_PackedToASCII(
                             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.
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. This function checks that each half-byte of the packed decimal data is in the range of 0 to 9. The only exception is the last half-byte which contains the sign indicator. 0 <= decimalPosition < (length * 2).