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,
Reading from COBOL file
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 125
- Joined: Mon Sep 11, 2006 4:22 am
- Location: India
Reading from COBOL file
Last edited by Roopanwita on Thu Jun 19, 2008 9:59 pm, edited 1 time in total.
What is the COBOL field definition for this column? It looks like a non-standard COMP-3 with leading sign from the binary.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 125
- Joined: Mon Sep 11, 2006 4:22 am
- Location: India
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.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 125
- Joined: Mon Sep 11, 2006 4:22 am
- Location: India
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
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.
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.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>