StringToDate() Mixed data single digit and double digits

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
MrBlack
Participant
Posts: 125
Joined: Wed Aug 08, 2012 8:57 am

StringToDate() Mixed data single digit and double digits

Post by MrBlack »

Hi

Does anyone know if there's a format mask that can handle mix digit lengths for the format mask of StringToDate() function? Example data:

Code: Select all

1/1/2015
02/02/2015
11/15/2015
My the string dates are consistent and this format mask in a transformer isn't working for me:

Code: Select all

StringToDate(DSLink1.DOB,"%mm/%dd/%yyyy")
And I've also tried:

Code: Select all

StringToDate(DSLink1.DOB,"%m/%dd/%yyyy")
But if change my data to always be 2 digits for month and day, then things work fine. I didn't see any format mask options on the IBM website but maybe I missed something.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You did miss something. In particular, the "s" option.

Read about it at http://www-01.ibm.com/support/knowledge ... rmats.html

Example: %(m,s)/%(d,s)/%yyyy
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