Environment Variable not working
Moderators: chulett, rschirm, roy
Environment Variable not working
I am defining a few env variables in DS Administrator as
A = valA
B=valB
C=valC
D=$A\$B\$C
I am declaring the variables in my job
and using D in my Sequential Stage to give me the directory path, but I am getting an error that its not abe to create the file. I have verified that the directories exist.
I have tried with $D , #$D# and have tried defining it in the JOB as $PROJDEF but it still keeps giving me the same error
All Help appreciated
A = valA
B=valB
C=valC
D=$A\$B\$C
I am declaring the variables in my job
and using D in my Sequential Stage to give me the directory path, but I am getting an error that its not abe to create the file. I have verified that the directories exist.
I have tried with $D , #$D# and have tried defining it in the JOB as $PROJDEF but it still keeps giving me the same error
All Help appreciated
Last edited by dscnn on Fri Jul 08, 2005 3:26 pm, edited 1 time in total.
-
- Participant
- Posts: 232
- Joined: Sat May 07, 2005 2:49 pm
- Location: USA
Hi,
Have you included the Environment Variables that you want to use in the job, in the parameters tab of the Job Properties?
If not, you can insert the Environment Variables that you defined using adminstrator, by clicking on Add Environment Variable button on the bottom right and picking the variable you want to use from the popup list.
When referring to the global environment variables in your job, use #$SOURCE#
I guess that should solve your problem.
Thanks,
Naveen
Have you included the Environment Variables that you want to use in the job, in the parameters tab of the Job Properties?
If not, you can insert the Environment Variables that you defined using adminstrator, by clicking on Add Environment Variable button on the bottom right and picking the variable you want to use from the popup list.
When referring to the global environment variables in your job, use #$SOURCE#
I guess that should solve your problem.
Thanks,
Naveen
Hi Naveen,
I have included the Environment variables on the Job Parameter Listing.
When I use the Env variables individually in my Sequential Stage like
#$A#\#$B#\#$C# it works OK
I have updated my initial Query to reflect the situation accurately
I have included the Environment variables on the Job Parameter Listing.
When I use the Env variables individually in my Sequential Stage like
#$A#\#$B#\#$C# it works OK
I have updated my initial Query to reflect the situation accurately
pnchowdary wrote:Hi,
Have you included the Environment Variables that you want to use in the job, in the parameters tab of the Job Properties?
If not, you can insert the Environment Variables that you defined using adminstrator, by clicking on Add Environment Variable button on the bottom right and picking the variable you want to use from the popup list.
When referring to the global environment variables in your job, use #$SOURCE#
I guess that should solve your problem.
Thanks,
Naveen
-
- Participant
- Posts: 232
- Joined: Sat May 07, 2005 2:49 pm
- Location: USA
Hi,
We are trying to incorporate 'extreme' flexibility. If $A or $B changes, we don;t want to go and change the other variable values unless its major, $D in this case, which may be multiple
Would appreciate if someone can tell how to use an value of an environment variable inside another environment variable itself, or simply, just give a solution of the initial query.
We are trying to incorporate 'extreme' flexibility. If $A or $B changes, we don;t want to go and change the other variable values unless its major, $D in this case, which may be multiple
Would appreciate if someone can tell how to use an value of an environment variable inside another environment variable itself, or simply, just give a solution of the initial query.
pnchowdary wrote:Hi,
Try declaring D=valA\valB\valC instead of D=$A\$B\$C in your Datastage Administrator.
Thats should take care of your problem.
Thanks,
Naveen
Our directotry structures can change a lot. We are using $D as the paths in out Sequential Stage and are trying to fill D in DS Administrator itself, by using othe env variables as decribed above. We don't want to change the jobs if the structure changes each time.
Although I haven't tried D=#$A#\#$B#\#$C# in my DS Administrator, which I'll do Monday morning.
In short, I am really looking for a way to use the values of env variables in other env variables themselves.
Although I haven't tried D=#$A#\#$B#\#$C# in my DS Administrator, which I'll do Monday morning.
In short, I am really looking for a way to use the values of env variables in other env variables themselves.
amsh76 wrote:Why can't you keep it like following:
#$A#\#$B#\#$C#....whats wrong in this? This takes care of your problem.
We are exactly doing as mentioned in the post but not as environment variables as parameters. #$A#\#$B#\#$C should work. This would give a problem, if your OS gets changed from windows to UNIX. So i would suggest you to have another variable to store directory separator so that you do not need to change the job even if your OS changed.
HTWH.
Regards
Saravanan
HTWH.
Regards
Saravanan
Hi Saravanan,
I am trying to use #$D# directly in my Sequential Stage instead of #$A#\#$B#\#$C#
and D = $A\$B\$C in DS Administrator is being defined.
I really need help on this fast, or atleast someone to tell me that it cannot work this way.
If it works a step by step approach will be great to know.
I am trying to use #$D# directly in my Sequential Stage instead of #$A#\#$B#\#$C#
and D = $A\$B\$C in DS Administrator is being defined.
I really need help on this fast, or atleast someone to tell me that it cannot work this way.
If it works a step by step approach will be great to know.
elavenil wrote:We are exactly doing as mentioned in the post but not as environment variables as parameters. #$A#\#$B#\#$C should work. This would give a problem, if your OS gets changed from windows to UNIX. So i would suggest you to have another variable to store directory separator so that you do not need to change the job even if your OS changed.
HTWH.
Regards
Saravanan