Page 1 of 1

Error with Date

Posted: Thu Jun 07, 2007 1:20 am
by cosec
I have a date field of the YYYY-MM-DD in a sequential file...When I load to the target table I am having an error as follows...

how do i fix this

LD_RMM_COLL_BAT..TRX_RMM_COLL_BAT_1: At row 113, link "Output", while processing column "COLL_DT"
Value treated as NULL
Attempt to convert String value "2007-05-23" to Date type unsuccessful

Posted: Thu Jun 07, 2007 2:33 am
by ray.wurlod
You start by informing us what the target database is, and what its expected date format is. Then you adjust your value accordingly.

Posted: Thu Jun 07, 2007 3:41 am
by cosec
expected date format YYYY-MM-DD
Target database : DB2

sequential file is of the form YYYY-MM-DD but when i run the job i get the error specified in the earlier message...



ray.wurlod wrote:You start by informing us what the target database is, and what its expected date format is. Then you adjust your value accordingly. ...

Posted: Thu Jun 07, 2007 4:12 am
by rafik2k
Use

Code: Select all

Oconv((Iconv(Arg1,"D-YMD")),"D-YMD[4,2,2]")
function to convert it into db2 date format.

Posted: Thu Jun 07, 2007 4:15 am
by rafik2k
rafik2k wrote:Use

Code: Select all

Oconv((Iconv(Arg1,"D-YMD")),"D-YMD[4,2,2]")
function to convert it into db2 date format.
Where Arg1= COLL_DT

Re: Error with Date

Posted: Thu Jun 07, 2007 5:47 am
by cosec
thanks guys
cosec wrote:I have a date field of the YYYY-MM-DD in a sequential file...When I load to the target table I am having an error as follows...

how do i fix this

LD_RMM_COLL_BAT..TRX_RMM_COLL_BAT_1: At row 113, link "Output", while processing column "COLL_DT"
Value treated as NULL
Attempt to convert String value "2007-05-23" to Date type unsuccessful

Posted: Thu Jun 07, 2007 7:18 am
by DSguru2B
As far as I remember, if its just date "DATE(10)", then db2 accepts it in internal format. If you just sent it as ICONV() it will accept it.