How to convert date foramts to other formats

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
e1994264
Premium Member
Premium Member
Posts: 28
Joined: Mon Jul 18, 2011 5:12 pm

How to convert date foramts to other formats

Post by e1994264 »

Hi,
I am getting date fields actually text fileds with various formats MM/DD/YY and YY/MM/DD . I need convert them to DD/MM/YYYY.
Please can any body tell the functions need to be used in converting date format and check the date ISv alid
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Re: How to convert date foramts to other formats

Post by zulfi123786 »

e1994264 wrote:I need convert them to DD/MM/YYYY.
What is your target, change of format only makes sense if your target is sequential file
e1994264 wrote:Please can any body tell the functions need to be used in converting date format and check the date ISv alid
There are no functions to change the format of date value that exists in text form. you need to take substrings and concatenate them to fit your requirement

ex - yyyy-mm-dd to DD/MM/YYYY

X[9,2]:'/':X[6,2]:'/':X[1,4]
- Zulfi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do you know, reliably, which format your source dates are in? For example is 08/08/08 a YY/MM/DD or a MM/DD/YY format?

If not, you're doomed.
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