Tools & Utilities

turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

01-25-2008
10:32 AM

01-25-2008
10:32 AM

I am trying to MLOAD some data from a mainframe file onto a teradata table. I'm entcountering a COMP field which simply doesnt load into the table. It is an amount field and is defined in mainframe as S9(13)V99 and has values of 0.00.

The field in the table as well as the input file definition is defined as DECIMAL (15,2) but when i run the job, I get a MLOAD error 2679 and the rows go into the error table.

Someone help me decide how i should define the field in the input file layout, as I think that is where the key lies.

Thanks

Mike

The field in the table as well as the input file definition is defined as DECIMAL (15,2) but when i run the job, I get a MLOAD error 2679 and the rows go into the error table.

Someone help me decide how i should define the field in the input file layout, as I think that is where the key lies.

Thanks

Mike

3 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

01-25-2008
11:59 AM

01-25-2008
11:59 AM

looks like you need to define an appropriate format...

we had a similar discussion sometime back, see if this thread interests you.

http://www.teradata.com/teradataForum/Topic10290-10-1.aspx

we had a similar discussion sometime back, see if this thread interests you.

http://www.teradata.com/teradataForum/Topic10290-10-1.aspx

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

01-31-2008
04:48 AM

01-31-2008
04:48 AM

Hi varun,

I did also have the same file layout once. I suppose you cannot load a COMP value in Teradata.

For e.g : a value defined in copybook as S9(9) will be represented as

000D

0070

i.e it will occupy 4 bytes and you cannot define it as DECIMAL(9,0) in your TD table as it will then expect a 5 byte record. Moreover defining the field as DECIMAL(8,0) also is wrong since its a S9(9).

So the best way is to request the source system to change the filed layout to COMP-3 and then you can load it.

But again if there is any way to load the COMP values I am not aware.

I did also have the same file layout once. I suppose you cannot load a COMP value in Teradata.

For e.g : a value defined in copybook as S9(9) will be represented as

000D

0070

i.e it will occupy 4 bytes and you cannot define it as DECIMAL(9,0) in your TD table as it will then expect a 5 byte record. Moreover defining the field as DECIMAL(8,0) also is wrong since its a S9(9).

So the best way is to request the source system to change the filed layout to COMP-3 and then you can load it.

But again if there is any way to load the COMP values I am not aware.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

01-31-2008
05:34 PM

01-31-2008
05:34 PM

COBOL COMP with

1-2 digits = BYTEINT

3-4 digits = SMALLINT

5-9 digits = INTEGER

10-18 digits = BIGINT

If you also have an implied decimal point in your COMP field, you will need to scale the number (divide by the appropriate power of 10) to convert to DECIMAL.

1-2 digits = BYTEINT

3-4 digits = SMALLINT

5-9 digits = INTEGER

10-18 digits = BIGINT

If you also have an implied decimal point in your COMP field, you will need to scale the number (divide by the appropriate power of 10) to convert to DECIMAL.