All Forums Analytics
subho 2 posts Joined 05/09
14 May 2009
Convert Decimal to Signed Numeric value

Teradata Table structure:
CREATE SET TABLE Table1,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT
(
field1 SMALLINT NOT NULL,
field2 DECIMAL(15,2) NOT NULL,
field3 DECIMAL(15,2) NOT NULL),
UNIQUE PRIMARY INDEX IXCSL1 ( field1 );

Record in Teradata

field1 | field2 | field3
1 | -123456789.31 | 56745111.78

Mainframe file Layout:

01 field2 PIC -(12)9.
01 field3 PIC -(12)9.

Output mainframe file for the Teradata records should look like

field1 | field2
blankspaceblankspace-123456789 | blankspaceblankspaceblankspaceblankspace56745112


I am trying to extract records from Teradata to Mainframe using BTEQ XPORT.

I have used various combinations of cast, format; I can think of. But I am not getting the desired result.


Any help will be appreciated.

Fred 415 posts Joined 08/04
14 May 2009

Use "Teradata style" cast:

field1 (FORMAT '-(12)9') (CHAR(13))

subho 2 posts Joined 05/09
15 May 2009

Wowowo.. It worked!!! Thank you so much!!

You must sign in to leave a comment.