Changing date format from YYYY-MM-DD to DD-MON-YY

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
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Changing date format from YYYY-MM-DD to DD-MON-YY

Post by vinothkumar »

Hi,
How can I change date format from "YYYY-MM-DD" to "DD-MON-YY" in parallel jobs.

Thanks
Vinoth
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... as strings, I assume?
-craig

"You can never have too many knives" -- Logan Nine Fingers
crystal_pup
Participant
Posts: 62
Joined: Thu Feb 08, 2007 6:01 am
Location: Pune

Post by crystal_pup »

DateToString(DSJobStartDate,"%dd-%mmm-%yyyy")

I used DSJobStartDate as an example, you can substitute it with your input date.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Date data types are stored in a binary form, so do not have formats.
To convert from one string representation to another, convert to and from Date data type with appropriate format strings. That is, use StringToDate() and DateToString() functions, assuming you're using a Transformer stage. Or date_from_string() and string_from_date() if you're using a Modify stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

Thanks. You guys rock as always..
Post Reply