Setting user defined Environment Variable to $ENV

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
thanush9sep
Premium Member
Premium Member
Posts: 54
Joined: Thu Oct 18, 2007 4:20 am
Location: Chennai

Setting user defined Environment Variable to $ENV

Post by thanush9sep »

Hi All

I have created a user defined Environment Variable called ORA_PWD and set the default value as $ENV

In the .profile I gave ORA_PWD=aaa; export ORA_PWD
if I put echo $ORA_PWD, I am able to see the value for ORA_PWD as 'aaa'

I used ORA_PWD = $ENV as job parameter in my job which contains ORACLE stage as source

I got the following error while I clicked the view button

---job parameter '$ORA_PWD' cannot take the special value '$ENV' when executing View Data. Only literal String values are allowed

when I ran the job I got the following error

---Missing Parameters $ORA_PWD [$ENV].

1. My question is do I have to restart the server after declaring ORA_PWD=$ENV?

2. Am I missing something while trying to get a value from the environment. If yes what is it?

I just went to almost all the post here, I guess I am missing something
Regards
LakshmiNarayanan
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In 7.5x2 View Data does not accept environment variable parameters with $PROJDEF, $ENV or $UNSET as default values at all.

You should not need to start the server. However, you probably do need to create an environment variable called ORA_PWD in the Administrator client. Set that one's default value as $ENV also.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
thanush9sep
Premium Member
Premium Member
Posts: 54
Joined: Thu Oct 18, 2007 4:20 am
Location: Chennai

Post by thanush9sep »

Thanks Ray

This is what I did to get the value of ORA_PWD from the Environment

I assigned a value for variable called PWD=aaa and then used the below command in the .profile
PWD=aaa;
export $PWD (dont know whether this is necessary or not)

dsadmin -envset ORA_PWD -value $PWD ProjectName

in the Administrator I kept ORA_PWD as string and DataStage took care of the rest

and each and every job I used $PRODEF for ORA_PWD

if I change PWD value in the .profile then ORA_PWD will change automatically in DataStage
Regards
LakshmiNarayanan
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not unless there's at least one reference to $ENV as a default value - either in the Administrator client or in the job parameters grid.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
thanush9sep
Premium Member
Premium Member
Posts: 54
Joined: Thu Oct 18, 2007 4:20 am
Location: Chennai

Post by thanush9sep »

Sorry Ray

I did not understand.
Regards
LakshmiNarayanan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The value you assign the environment variable in the Administrator should be $ENV and the default value of that environment variable when you add it to your job should be changed to $PROJDEF. In the job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply