Page 1 of 1

Date Warning from DB2 Extract,Load to Cobol file (complex)

Posted: Sun Mar 16, 2008 9:18 am
by ds2000
I have a db2 table of around 400+ columns and it has around 9 million rows. Extracting from this table doing some transformation and loading to a .cob file. After loading few million rows it gave me the following error and then job was aborted because i have routine that aborts if warning comes up.
Then i did query on Field 15 but there is no Date value that is later than 9999-12-31 or earlier than 0001-01-03 in the table.

Following is warning msg:

Warning:
db2Mytable,0: Invalid date value in setOutputFieldAsDate() for field '15' in output dataset '0'.
Date cannot be later than 9999-12-31 or earlier than 0001-01-03.
Julian days value = 1721424.

Posted: Sun Mar 16, 2008 10:09 am
by ArndW
What type is the column defined as in DB2? I wonder where you are doing the Julian date conversion.

Posted: Sun Mar 16, 2008 1:36 pm
by ds2000
its db2 date type.

Posted: Mon Mar 17, 2008 2:05 am
by ArndW
I'm not sure if the "field 15" is conted starting at 1 or 0 - are both of those columns dates, and if so could you check the range? I still don't understand how or where the Julian Date figures into this.

Posted: Mon Mar 17, 2008 6:06 am
by ds2000
I checked columns 15, 16 and colum 15 and 16 is db2 date type width 10. Im running query for column 16 for any date that is not in the range.

Posted: Mon Mar 17, 2008 4:45 pm
by ds2000
Arnd,
So when i checked column 16 it had 2 rows with 1000-01-01 date. It means column counting starts from 0. That column was notnullable so db2 put that default date in it.

However i figured out the problem and fixed the rows. Thanks.