DateFunction

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
Rajesekhar
Participant
Posts: 19
Joined: Fri May 14, 2010 3:54 pm

DateFunction

Post by Rajesekhar »

What function can I use to convert date from Mon dd,yyyy to YYYY-MM-DD?

-Thanks
Raj
Rajesekhar Potteti
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

When's the interview?

This can't be done with a single function, you need a minimum of two. Which two will depend on the data types involved, information that you have not supplied.

Probably some combination of DateToString() and StringToDate(), with appropriate date format strings, will do it for you.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rajesekhar
Participant
Posts: 19
Joined: Fri May 14, 2010 3:54 pm

Post by Rajesekhar »

hahaha good one!!

but iam not appearing for any interview...

I am new to DataStage and trying out things...

Both input and output are of type Date.

Can you help me now? :)
Rajesekhar Potteti
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Dates do not have formats. They are stored in a 32-bit structure in a binary format. Therefore your requirement is moot.

If you need to "translate" the dates from how they appear (as strings) in source and target, then you need to specify an appropriate format property in the stages that refer to them.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply