Datetime on Sequential File

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
kld05
Charter Member
Charter Member
Posts: 36
Joined: Fri Apr 28, 2006 8:12 am

Datetime on Sequential File

Post by kld05 »

I have a value of Mar 23 2009 12:00AM on a sequentual file that I need to convert to 20090323 format. I'm wondering what the best approach is. String manipulation or date conversion functions.

Thanks in advance guys.
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

Unless DS has been messing me around, you can't do date manipulation unless the field is in the date format specified by your project, which I suspect will require string manipulation first...

Of course, if your project specifies date format as MMM DD YYYY then I guess you are already halfway there
betterthanever
Participant
Posts: 152
Joined: Tue Jan 13, 2009 8:59 am

Re: Datetime on Sequential File

Post by betterthanever »

are you writing file to file??? or from file to a DB table???
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

When you say "on" a sequential file, do you actually mean *in* a sequential file? You won't be able to do pure "string manipulation" as you can't just rearrange the original value to get the desired result. So, hack off the time and then use the normal "date conversion functions" for the rest.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Conversion functions StringToTimestamp(), TimestampToDate() and DateToString() should do it.
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