Read DB2 data - Date Format problem

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
bart12872
Participant
Posts: 82
Joined: Fri Jan 19, 2007 5:38 pm

Read DB2 data - Date Format problem

Post by bart12872 »

Well, I have a problem, and I have no idea where it could come from.

A DB2 Enterprise Stage read a table. The table contains dates.
When I do a view data, all the dates are '1901-01-01' the default value.

but when I do a CAST(column AS CHAR(10)), I obtain the good value but in the format 'MM/DD/YYYY'

I try to modify in the Datastage administrator the default format for date as '%mm/%dd/%yyyy' but the view data is still '1901-01-01'

I make a select in telnet from the db2 client and the good date is return.

You can imagine that I can't use to_char() for all date column.

Do you have an idea on how retrieve the good dates ?

thanks
Martin.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try either creating a new job (to pick up your new default that you set in Administrator) or changing the existing job's job properties to set the new format there.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSkkk
Charter Member
Charter Member
Posts: 70
Joined: Fri Nov 05, 2004 1:10 pm

Re: Read DB2 data - Date Format problem

Post by DSkkk »

bart12872 wrote:Well, I have a problem, and I have no idea where it could come from.

A DB2 Enterprise Stage read a table. The table contains dates.
When I do a view data, all the dates are '1901-01-01' the default value.

but when I do a CAST(column AS CHAR(10)), I obtain the good value but in the format 'MM/DD/YYYY'

I try to modify in the Datastage administrator the default format for date as '%mm/%dd/%yyyy' but the view data is still '1901-01-01'


thanks
Martin.
Hi Martin- We are facing the Exact same Issue. Can u please Post the Resolution for this Issue as it would be a great help to us. Thanks
g.kiran
Post Reply