Mload a COMP field from mainframe

Tools & Utilities

Mload a COMP field from mainframe

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.



Re: Mload a COMP field from mainframe

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

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

Re: Mload a COMP field from mainframe

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
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.
Teradata Employee

Re: Mload a COMP field from mainframe

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.