Converting the source data into timestamp

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
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Converting the source data into timestamp

Post by laknar »

Hi,

how to convert this into (13 NOV 2008 21:06) timestamp format
swarnkar
Participant
Posts: 74
Joined: Wed Jan 11, 2006 2:22 am

Re: Converting the source data into timestamp

Post by swarnkar »

laknar wrote:Hi,

how to convert this into (13 NOV 2008 21:06) timestamp format
Hi Laknar,

first you have to convert it into internal format with help of Iconv Function. and then you can convert back this value to readable format by Oconv. Like
Oconv(Iconv(Field_Name[1,11],"D"),"D/YMD[4,2,2]"):" ":Field_Name[13,5]:":00"

So your output would be "2008/11/13 21:06:00".
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do tell. Iconv() and Oconv() are not available in parallel jobs. You will need to convert the date portion into a date and then back again to a string with a different format (StringToDate() and DateToString() functions) then concatenate the time portion and the seconds (":00").
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