Date conversion

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
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

Date conversion

Post by kollurianu »

Hi All,

can i use i Iconv for the following dates

format is mm/dd/yyyy and if the date comes as 5/8/2005.

Thank you all for help,
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sure, that should work fine. Now, that's a Server job answer as you marked the post as Server. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

Post by kollurianu »

so even if the date comes as 5/8/2005 (mm/dd/yyyy) instead
of 05/08/yyyy still can i use "iconv" function.

Please confirm me.


Thank you,
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Open DS Manager and write a quick function to test. Your logic would be:

Ans = ICONV(Arg1, "D")

where Arg1 will contain a test date. Hit your Compile button and then the Test button and try 5/8/2005 as the argument. Hit Run and see if the result looks like a number around 13600. I don't know the exact number, but May 15th 1995 was day 10000, so 10 years * 365 days is about 13600.

You will find that ICONV(Arg1, "D/MDY[2,2,4]") is the exact conversion code for your date format. Just a "D" means try to figure it out.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

Post by kollurianu »

Thank you so much Kenneth Bland.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Just "DMDY" means that the date's in month-day-year order, and Iconv can figure out anything else (delimiters, alpha or numeric month, two or four digit year, and so on).
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