Hi
I am trying to read a environment variable and assign it to a local variable in transform stage. is that possible ? Basically, I have used env variable in my job it works but when I am trying to assign it to a local variable or port and store it in target as a field, it's not working ? any clues ???
Thanks
Environment Variables
Moderators: chulett, rschirm, roy
Welcome aboard.
Typically, you define a Job Parameter and assign it the value of the environment variable. You then use it in your job like any other parameter.
You will, however, need to clarify what exactly this means before we can make any meaningful comments:
Typically, you define a Job Parameter and assign it the value of the environment variable. You then use it in your job like any other parameter.
You will, however, need to clarify what exactly this means before we can make any meaningful comments:
It works but it's not working? How are you currently 'using' it in your job and how are you trying to assign it to a 'local variable'? Specific examples would be good. Also include your DataStage version - 7 dot what? - as the way environment variables work have changed (for the better) in every 7.x release so far from what I recall.Basically, I have used env variable in my job it works but when I am trying to assign it to a local variable or port and store it in target as a field, it's not working ?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Charter Member
- Posts: 199
- Joined: Tue Jan 18, 2005 2:50 am
- Location: India
Re: Environment Variables
reading the above part, of your thread, I feel that with local variable you mean Job Parameter and if i am correct, then I must tell you; that you cannot re-initialize a job parameter of a job, in one of the stages of the same job.kaps wrote:Hi
Basically, I have used env variable in my job it works but when I am trying to assign it to a local variable or port and store it in target as a field, it's not working ? any clues ???
Job parameter are initialized in the begining while running the job. if you try to over-ride the value which was set earlier, it wont be re-initialzed and unfortunately even the datastage job wont return any error or warning message.It will be executed successfully.
Shantanu Choudhary
Thanks for the replies. Data Stage Designer version 7.5.
Let me rephrase my question.
Actually what I am trying to do is to read an environment variable and assign the value of that
as a column and store that in my target.
Example
I have a environment variable called env1.
my job structure is like this.
source-->Transform-->Target
In my transform stage I am adding one column say Test ans assign env1 value to it.
Derivation Column Name
---------- -----------
#env1# Test
This is not working...
Expecting your reply
Thanks
Let me rephrase my question.
Actually what I am trying to do is to read an environment variable and assign the value of that
as a column and store that in my target.
Example
I have a environment variable called env1.
my job structure is like this.
source-->Transform-->Target
In my transform stage I am adding one column say Test ans assign env1 value to it.
Derivation Column Name
---------- -----------
#env1# Test
This is not working...
Expecting your reply
Thanks
-
- Premium Member
- Posts: 224
- Joined: Tue Sep 24, 2002 7:32 am
- Location: Denver, CO USA
assignement ???
I have created the job parameter and assign env variable to it. used $PROJDEF in default value. Now when I assign this to a column I am getting an error.
I assigned it like this in derived column...
#env1#
#$env1#
But it throws an error ? What am I doing wrong ?
Thanks
I assigned it like this in derived column...
#env1#
#$env1#
But it throws an error ? What am I doing wrong ?
Thanks
-
- Premium Member
- Posts: 224
- Joined: Tue Sep 24, 2002 7:32 am
- Location: Denver, CO USA