cwbDT_ASCII11ToBin4

Purpose

Translates (exactly) 11 ASCII numeric characters to a 4-byte integer stored most significant byte first. (The source string is not expected to be zero-terminated.) This function can be used for translating ASCII numeric data to the iSeries™ integer format.

Unicode version

cwbDT_Wide11ToBin4

Syntax

 
unsigned int CWB_ENTRY cwbDT_ASCII11ToBin4(
                             char *target,
                             char *source);

Parameters

char * target - output
Pointer to the target (4 byte integer).
char * source - input
Pointer to the source (11 byte ASCII).

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 target data will be stored with the Most Significant Byte first. This is the format that the iSeries server uses and is the opposite of the format that is used by the Intel® x86 processors. Valid formats for the ASCII source data are as follows:

Examples:

 "   +    123"
 "-    123   "
 "     +123  "
 "        123"
 "       -123"
 "+123       "