FastExport - Unloading and matching with Cobol datatypes

Tools

FastExport - Unloading and matching with Cobol datatypes

Hi All,

This is an issue i have, please help.

The scenario is there is FIELD1 (SMALLINT) in a table which is unloaded (FastExport). This file is to be opened in COBOL and the same is matched to a field. The SMALLINT field is stored in the file as a packed field of length of 4 (Hex Value). But cobol requires it as a Packed field of 2 (Hex value).

What mapping can we use to unload this SMALLINT field to match with the COBOL field?

Regards
Mohan R
3 REPLIES
Teradata Employee

Re: FastExport - Unloading and matching with Cobol datatypes

SMALLINT will be exported as two-byte binary - COBOL S9(4) COMP - by default.
If you want it to be packed decimal in the file, you can CAST to DECIMAL in the FastExport.
Enthusiast

Re: FastExport - Unloading and matching with Cobol datatypes

Can any one guide me how can i load the S9(13)V9(02) COMP variable into Teradata table.
How can i CAST that into DECIMAL variable so that i wont miss any data.

Thank you
Madhavi.
Enthusiast

Re: FastExport - Unloading and matching with Cobol datatypes

Define the field as Decimal(15,2). On the input use the conversion

:field (DECIMAL(15,2),FORMAT'9(13)V9(2)S')
or
CAST(:field AS DECIMAL(15,2) FORMAT '9(13)V9(2)S')

Note that only the first one is valid for FastLoad.

PIC S9(x)V9(y) means
total digits = x+y
Digits after decimal = y

decimal(x,y) in teradata = PIC S9(m-n)V9(n) COMP -3

Let me know if this helps.