Issue with date...

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
mallireddibalaji
Participant
Posts: 24
Joined: Wed Mar 19, 2008 1:13 am

Issue with date...

Post by mallireddibalaji »

Hi Guru's,

we have a issue with DATE feild column,

From source we are getting varchar feild, this varchar is mapping to DATE feild in target.

Due to source is VARCHAR, we are getting CHARACTERS for this feild but target is date field.

due to this reason job getting aborted.

For source field the data type must be varchar, then how to eliminate the CHARACTERS from source field?

Please help me on this issue


Thanks in advance.
M.BALAJI
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There are myriad conversion functions, such as StringToDate(). Research them and choose an appropriate one.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:? What 'characters' are you getting? How about posting some examples?
-craig

"You can never have too many knives" -- Logan Nine Fingers
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

Look in the import stage (Output tab/Format tab) under the Type Defaults category - there are Date formatting options. If you have a consistent date pattern in your input field, the format string option will help convert it automatically from char/varchar to date using that format string.

For example, if you are recieving '2008-01-01', then the format string would be %yyyy-%mm-%dd, which is actually the default. 10/01/2008 would be %dd/%mm/%yyyy, etc. If you have inconsistent or non-standard formats, then consider using a transform or buildop to convert to date. As chulett said, there are many different ways to convert it. You can also import as a string and use a modify stage to convert to date.

Brad
It is not that I am addicted to coffee, it's just that I need it to survive.
Post Reply