I apologize if I'm duplicating past posts, but I was not able to find the answer to my question in my searching...
Is it possible to reference an Environment variable in a Routine without passing it as a parameter? Our objective is to reduce the number of parameters being passed to jobs thereby increasing the number of jobs that can fit in each sequencer.
Thanks in advance!
Heather
Referencing Environment Variables in Routine
Moderators: chulett, rschirm, roy
Referencing Environment Variables in Routine
what a man is contributes much more to his happiness than what he has, or how he is regarded by others.
Hi,
The question is what or how the environment variable is defined in your design? (dynamic or static)
Will it be visible to the running job when the job runs? (can't run test any time soon here )
Usualy the strait forward answer is NO, but depending on what you want to achieve or why do you want to reduce the number of parameters in your jobs I think we may manage a way to do what you need.
IHTH,
The question is what or how the environment variable is defined in your design? (dynamic or static)
Will it be visible to the running job when the job runs? (can't run test any time soon here )
Usualy the strait forward answer is NO, but depending on what you want to achieve or why do you want to reduce the number of parameters in your jobs I think we may manage a way to do what you need.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
In parallel jobs there is a GetEnvironment function but I don't know of an equivelent one in BASIC. You could you DSExecute to run an echo command. It's not a very good programming practice as it stops your routine from operating as a black box. It can lead to misunderstandings from support in production as they expect to be able to override job parameters via director but the routines go directly to the environment.
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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Not direct, but you can use DSExecute. Either go to the operating system and echo the value of the environment variable, or go to UV and use the ENV command. I prefer the former, though you need to make it platform specific, for example echo %TMPDIR% for Windows but echo $TMPDIR for UNIX.
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.
Thanks everyone. That's what we pretty much guessed. Too bad. It would make Environment variables quite a bit more useful if you could reference then easily in routines.
Thanks for your help
cheers
Heather
Thanks for your help
cheers
Heather
what a man is contributes much more to his happiness than what he has, or how he is regarded by others.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The UniVerse/DataStage shell (uvsh or dssh) doesn't really support the concept of environment variables, which is why an indirect mechanism is needed to get at the parent shell's environment variables.
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.