need to convert days to date

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
HemaV
Participant
Posts: 63
Joined: Wed Jan 09, 2008 1:38 am
Location: Bangalore

need to convert days to date

Post by HemaV »

Hi All,
I have a requirement where i get values from my source file as:
13002
13020
13037

my o/p will be:
2013-01-02
2013-01-20
2013-02-06

which means from source, 1st 2 chars ie, 13 indicates 2013 and next 2 chars indicates date and month, say:
02 -> 2-Jan
20 -> 20-Jan
33 -> 6-Feb

How can I achieve this scenario in parallel job, is there any function to get o/p like this?

Thanks in Advance,
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Actually that is an ordinal date where the last three are the number of days into the year, which some people call a Julian date but really isn't as that would be the number of days from 4713 BCE January 1 @ noon GMT.

Use %ddd in your StringToDate() date format to indicate "day of year" assuming your output is actually a DATE. If it is another string then you'll need to convert again back to a string in that format.
-craig

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