Setting value of User Defined Environment Variable
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 221
- Joined: Fri Feb 17, 2006 3:38 am
- Location: India
- Contact:
Setting value of User Defined Environment Variable
Hi,
I have a situation where i need to use environment variable value in a sequence of jobs.
I wanted to know that, is there any way in which i can set the environment variable value in any stage for example in Transformer.
I tried to do it by passing Stage Variable value directly to a User Defined Environment variable but it did'nt work.
Kindly suggest
I have a situation where i need to use environment variable value in a sequence of jobs.
I wanted to know that, is there any way in which i can set the environment variable value in any stage for example in Transformer.
I tried to do it by passing Stage Variable value directly to a User Defined Environment variable but it did'nt work.
Kindly suggest
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
Parag Saundattikar
Certified for Infosphere DataStage v8.0
Parag,
you can set the UNIX or WINDOWS environment variables in a transform stage but the changes are only going to be visible inside that transform and in no other places. This is because actions are performed by different processes that run independantly of each other. The only common environment variable values will be those inhereted from the original calling process.
you can set the UNIX or WINDOWS environment variables in a transform stage but the changes are only going to be visible inside that transform and in no other places. This is because actions are performed by different processes that run independantly of each other. The only common environment variable values will be those inhereted from the original calling process.
From your post, i guess your requirment would be to set a envirnment variable to particual job or to a series of job based on a conditon.
If that is a case, you can use 'UserVariableActivity'.
Built for the same reason.
If that is a case, you can use 'UserVariableActivity'.
Built for the same reason.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
What did you try? Or how did you try? Please let us know.
I tried to do it by passing Stage Variable value directly to a User Defined Environment variable but it did'nt work.
If I remember correctly, you can call a environment variable in your stages like this way:
Code: Select all
#$ENV_VARIABLE#
Naveen.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
-
- Participant
- Posts: 221
- Joined: Fri Feb 17, 2006 3:38 am
- Location: India
- Contact:
naveendronavalli wrote:What did you try? Or how did you try? Please let us know.
I tried to do it by passing Stage Variable value directly to a User Defined Environment variable but it did'nt work.
If I remember correctly, you can call a environment variable in your stages like this way:
Thanks,Code: Select all
#$ENV_VARIABLE#
Naveen.
Hi,
I think in Transformer we don't need to include # with the environment variable.
I wrote: $enFileName = DSLink.instance
here instance is a source file column from where i need to pickup certain data, and on the basis of this data i need to create different files automatically.
for example if data in "instance" is 812 then environment variable is set and then in the next stage in sequence another job must check the environment variable value and based on this certain transformations are to be applied.
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
Parag Saundattikar
Certified for Infosphere DataStage v8.0
-
- Participant
- Posts: 221
- Joined: Fri Feb 17, 2006 3:38 am
- Location: India
- Contact:
Hi Kumar,kumar_s wrote:From your post, i guess your requirment would be to set a envirnment variable to particual job or to a series of job based on a conditon.
If that is a case, you can use 'UserVariableActivity'.
Built for the same reason.
I am already using UserVariableActivity.
But for that i need to predefine those values in that stage. but my requirement is to check the incomming data from a source column and then set an environment variable value. and later use that value to check & perform certain transformations on data in the later stages
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
Parag Saundattikar
Certified for Infosphere DataStage v8.0
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 221
- Joined: Fri Feb 17, 2006 3:38 am
- Location: India
- Contact:
Hi Ray,ray.wurlod wrote:Does it have to be an environment variable? Can you use a system variable (such as @USER0), or the job's user status area? ...
Actually i was not sure whether a system variable value is accessible across multiple jobs in a sequence.
But i thought that if i can set environment variable then it can be accessible across multiple jobs.
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
Parag Saundattikar
Certified for Infosphere DataStage v8.0
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Alas, the environment variable changed value is not inherited by the parent process (the job's controlling job sequence), so that approach fails. So does the approach using system variables, for a similar reasons; the jobs run in different processes from the job sequence.
However, the job sequence can pick up a value set in one job's user status area and pass it to another job as a parameter. Such an approach may work for you.
However, the job sequence can pick up a value set in one job's user status area and pass it to another job as a parameter. Such an approach may work for you.
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.
-
- Participant
- Posts: 221
- Joined: Fri Feb 17, 2006 3:38 am
- Location: India
- Contact:
Hi Ray,ray.wurlod wrote:Alas, the environment variable changed value is not inherited by the parent process (the job's controlling job sequence), so that approach fails. So does the approach using system variables, for a si ...
I was not able to see the entire content of your reply probably because you are a premium member.
Actually in my job i need to provide a default value to the environment variable at the starting of the sequence by passing the default value through a parameter in a UserVariableActivity.
but i don't know how can i supply system variable as a parameter at the starting of the sequence.
how can i define my own system variables
can you please help
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
Parag Saundattikar
Certified for Infosphere DataStage v8.0
Hmm.... His point is... If you change the Environmental Variable at the mid of the execution of a sequence, the chaged value wont be reflected to the main job control, and hence wont refelect to the upcomming called jobs.
So you need to use some of the conventional methond of passing values among jobs.
So you need to use some of the conventional methond of passing values among jobs.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'