Hi there,
I am looking to find a way to automatically generate a string like YYYY-MM (current year and month) within a a job sequence and then pass it through to the jobs.
Have you guys got any idea on how to aproach this?
Thanks
Enviroment Variable
Moderators: chulett, rschirm, roy
Ignoring your thread title and answering the question as asked would lead me to say - create a 'current month and year' routine that returns that value. Call it using a Routine Activity stage, the output of which can be easily passed in as a parameter value to any downstream jobs. ![Wink :wink:](./images/smilies/icon_wink.gif)
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
If you are on 7.5.1 you will need to call your routine via the Set Variables stage rather then a routine stage. You could also put the BASIC code directly into the Set Variables stage and not use a routine but that would not be as re-usable.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Hi Guys,
I am currently using datastage 7.0. I have already known about the function alternative but am trying to avoid it as writing code in ds basic makes dificult the maintenance. My guess was to use environmet variable with a formula in its value but dont know how to implement it and if it's possible.
I will wait for other suggestions.
Thanks
I am currently using datastage 7.0. I have already known about the function alternative but am trying to avoid it as writing code in ds basic makes dificult the maintenance. My guess was to use environmet variable with a formula in its value but dont know how to implement it and if it's possible.
I will wait for other suggestions.
Thanks
I'd rethink that assertation as 'writing code in ds basic' is part and parcel of working with Server jobs. Well structured and well documented code will greatly ease the maintenance issues with any product.mchaves wrote:I have already known about the function alternative but am trying to avoid it as writing code in ds basic makes dificult the maintenance.
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If you're working with 7.5 you can use an expression directly in the job parameter value allocation.
would do it. Or you could use the DS Transform
Code: Select all
Oconv(@DATE, "D-YM[4,2]")
Code: Select all
MONTH.TAG(@DATE)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.