date conversion funtion

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
sagar deshmukh
Participant
Posts: 103
Joined: Fri Jan 18, 2008 12:55 am
Location: chennai

date conversion funtion

Post by sagar deshmukh »

Hi ,

from my souce I am getting date like '2010-04-16-16.08.02.945000'

I want to convert it into the yyyy-mm-dd format

is there any function available to do this?

My source is a csv file.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

What is your source ? Is it a sequential file or table ?

If sequential file, you can define it as Varchar and extract as

Code: Select all

yourStringDate[1,10]
For table, search from TimeStampToString function
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Since it is already in that external format, just has a few extra bits, as noted the simplest solution would be to substring.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply