Help with @Date as "092014" instead of "92014

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Childrensmn
Premium Member
Premium Member
Posts: 32
Joined: Mon Apr 12, 2010 3:42 pm
Location: Minneapolis
Contact:

Help with @Date as "092014" instead of "92014

Post by Childrensmn »

Hello,

I have the following script in my batch to load month and year dynamically. I pass the below parms to jobs in the batch.

Current_Month = OCONV(@Date,"DM")
Current_Year = OCONV(@Date,"DY")

However the result is
Current_Month = "9" and I would like that to be "09".

Any tip is appreciated.

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

Post by chulett »

Probably other ways but off the top of my head:

Current_Month = OCONV(@Date,"DM[2]")

Your month parameter will also have to be a string, of course.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Childrensmn
Premium Member
Premium Member
Posts: 32
Joined: Mon Apr 12, 2010 3:42 pm
Location: Minneapolis
Contact:

Post by Childrensmn »

Thank You!!
Post Reply