Reading from COBOL file

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Roopanwita
Participant
Posts: 125
Joined: Mon Sep 11, 2006 4:22 am
Location: India

Reading from COBOL file

Post by Roopanwita »

Hi,
My job reads from COBOL file(used sequential file as source) and write into ORACLE stage.
In my sorce file columns are Decimal & NChar. The job is getting aborted with arror msg "seq_src,0: Field "<column name>" has import error and no default value; data: {0c 00 00 00 " P 0c @ @ @ @}, at offset: <--> " . and it is giving problem with column which has datatype Decimal.
If I change the datatype of Decimal column to Integer, the column value becomes different (eg - when datatype is Decimal a column value shows '25.' & when I cahne datatype to Integer it shows '-987672911')
If I am using Complex Flat file as source the job is running properly n data is populated properly.(as to make job design consistent I dont want to use CFF ,as other jobs are working prperly wth same design- with Sequential File)

thanks,
Last edited by Roopanwita on Thu Jun 19, 2008 9:59 pm, edited 1 time in total.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

What is the COBOL field definition for this column? It looks like a non-standard COMP-3 with leading sign from the binary.
Roopanwita
Participant
Posts: 125
Joined: Mon Sep 11, 2006 4:22 am
Location: India

Post by Roopanwita »

COBOL file column defn Netive type =DECIMAL, Length =2 ,Scale=0,Level number =02,Sign indicator =Signed, Usage= COMP-3
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

That is not the COBOL definition, but is close and might be enough. I don't like the "0c" hex at the beginning which would indicate a leading sign which is nonstandard. If your COBOL doesn't have a leading sign specificed then you probably already have a wrong position. Also, the data type is 2 digits yet you seemt to have 10 or 11.
Roopanwita
Participant
Posts: 125
Joined: Mon Sep 11, 2006 4:22 am
Location: India

Post by Roopanwita »

I have noticed that when Column value is Decimal(2) then it is returning value '15.', which seems proper, but if i m converting it to Integer(2) ,it is returning '-717222919'.Is it the value in some other format.

I couldnt understand "If your COBOL doesn't have a leading sign specificed then you probably already have a wrong position. " this line..can you please explain me...
thanks
Last edited by Roopanwita on Thu Jun 19, 2008 9:36 pm, edited 1 time in total.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

COMP-3 is also known as BCD where each position is encoded in 4bits. Another 4 bits are used for the sign and the result is padded to an even byte boundary. If you declare it as binary integer, then the 16 bits are used as an excess-128 representation and you get the negative number.
Post Reply