The conversion library

Top  Previous  Next

The XCONV conversion library (libxconv.so) contains functions invoked by the converter programs to properly handle the conversion of different data types.

XCONV

It must be the first called function, which provides to check file size and stores conversion direction.

Prototype

int XCONV(unsigned int direction, BYTE *filename, unsigned int record_length)

 

Parameters

direction            conversion direction
                           0 = ASCII  --> EBCDIC
                           1 = EBCDIC --> ASCII

filename             name of the file to be converted

record_length        record length

XCONVCHAR

This function converts character fields

Prototype

int XCONVCHAR(unsigned char *area, int len)

Parameters

area                 address of the area to be converted

len                  size of the area

XCONVZONED

This function converts numeric signed display fields

Prototype

int XCONVZONED(unsigned char *area, int len)

 

Parameters

area                 address of the area to be converted

len                  size of the area

XCONVDBCS

This function converts field through a specific codepage table, previously loaded by XCONV.

Prototype

int XCONVDBCS(unsigned char *area, int len)

 

Parameters

area                 address of the area to be converted

len                  size of the area

ZERO2NOTNUMERIC

This function checks and changes any blank or binary zero (X"00")  value into zero char (X"30" ASCII) on numeric signed display fields.

Prototype

int ZERO2NOTNUMERIC(unsigned char *area, int len)

 

Parameters

area                 address of the area to be converted

len                  size of the area

XCONVDUMP

This function is called automatically on error to display an hexadecimal dump of a wrong record.

The program dumps record and stops execution.

Prototype

int XCONVDUMP(unsigned char *area, int len)

 

Parameters

area                 address of the area to be converted

len                  size of the area