Error with Date

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

Error with Date

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

Post 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. ...
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

Post by rafik2k »

Use

Code: Select all

Oconv((Iconv(Arg1,"D-YMD")),"D-YMD[4,2,2]")
function to convert it into db2 date format.
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

Post 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
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

Re: Error with Date

Post 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
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply