All Forums Tools
varun2102 37 posts Joined 12/06
25 Jan 2008
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.ThanksMike

joedsilva 505 posts Joined 07/05
25 Jan 2008

looks like you need to define an appropriate format...we had a similar discussion sometime back, see if this thread interests you.

idg_tddevex 18 posts Joined 10/06
31 Jan 2008

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 as000D0070i.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.

Fred 1096 posts Joined 08/04
31 Jan 2008

COBOL COMP with 1-2 digits = BYTEINT3-4 digits = SMALLINT5-9 digits = INTEGER10-18 digits = BIGINTIf 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.

You must sign in to leave a comment.