YYYYMMDD -> YYYYDDD

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
jzajde1
Premium Member
Premium Member
Posts: 21
Joined: Wed Jan 07, 2015 8:10 am

YYYYMMDD -> YYYYDDD

Post by jzajde1 »

Hello -

I am trying to convert a string(which is a date) YYYYMMDD to YYYYDDD.
The YYYYDDD columns need to remain in a decimal format since this field is going to be packed in the CFF Stage.

Please advise.

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

Post by chulett »

I'd look at the StringToDate() followed by DateToString() with %ddd for the day on the way back to a string. Then if you need to, convert the final string to a number. Not aware of a way off the top of my head to do this with a single function.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jzajde1
Premium Member
Premium Member
Posts: 21
Joined: Wed Jan 07, 2015 8:10 am

Post by jzajde1 »

@Chulett -

Worked like a charm! Thanks for your help.

Jared
Post Reply