Environment Variables not reset after export

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
BIuser
Premium Member
Premium Member
Posts: 238
Joined: Thu Feb 02, 2006 4:03 am
Location: South Africa

Environment Variables not reset after export

Post by BIuser »

I have certain environment variables set up across all three of my environments on the Datastage Server. There is one Datastage server with a development environment, testing environment, QA environment and production environment. When I export jobs to a DSX file from the development environment and then import the DSX file into the Testing environment, the values of the environment variables are not updated to show the new environment. i.e. A variable called DSN=Dev_Example does not automatically get updated to DSN=Test_Example.

Can someone tell me where I can make a change to the settings so that this happens automatically. It's really tiresome having to keep updating the enviroment variables as one moves from environment to environment.

Thanks.
Barbara
-------------------------
https://www.ssa.co.za
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Re: Environment Variables not reset after export

Post by ArndW »

BIuser wrote:... i.e. A variable called DSN=Dev_Example does not automatically get updated to DSN=Test_Example.
How could DataStage know which values to use unless you tell the application what values to use.
These environment variable values are stored in the text file called "DSParams", each project has its own file stored in the project directory.
BIuser
Premium Member
Premium Member
Posts: 238
Joined: Thu Feb 02, 2006 4:03 am
Location: South Africa

Re: Environment Variables not reset after export

Post by BIuser »

DataStage does know what the values are because we have updated the Environment Variables on the Project level.

What I'm saying is that when you move the jobs from one environment to another, it does not update the variables to reflect the new environment, it keeps the variables of the previous environment. Surely if you move jobs between environments, DataStage should update the variables to the next environment settings ?
-------------------------
https://www.ssa.co.za
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That shouldn't be necessary, so I'm guessing you're not using them correctly. Parameter values are never changed during any import or export operation. If you have them setup in each Project with certain default values, what you want to use in each job as the default value there is $PROJDEF. That way what you seek will indeed happen.

I'd wager you've pulled the actual values themselves from the Project level variables into each job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
BIuser
Premium Member
Premium Member
Posts: 238
Joined: Thu Feb 02, 2006 4:03 am
Location: South Africa

Post by BIuser »

Ok, let me try to explain. When we set up Datastage we created 3 different projects. Each of these projects have EXACTLY the SAME environment variables but they have been defined on each project. Since each project is a different environment, the values between the projects change. For example: In Development, the #$SERVER# environment variable = SERVER1DEV BUT then in the Testing environment the SAME variable will have the following value: SERVER1TEST. Now when we export the jobs from the development environment to the testing environment the SERVER variable stays SERVER1DEV instead of updating itself to the new value which is SERVER1TEST. The variables are defined at project level why should they be changed at job level as well between exports/imports ?

i know Version 8.0 (Enterprise) of Datastage allows the values to be updated automatically between environments when importing / exporting. I wonder if this isn't a Versioning difference then ?
-------------------------
https://www.ssa.co.za
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No need to explain, I understood perfectly what you are doing - and what you are doing is (almost) the same as many other installations are doing. That's what Project level Environment Variables are for. However, you've missed the key point in my post, which explains why there's no need to change anything at the job level when migrating between projects when things are setup properly.

You setup your SERVER parameter (for example) in each Project via the Administrator with a different value, each appropriate for the environment. You assign the actual value of 'SERVER1DEV' there but that's not what you need in the job. When you add the Environment Variable to your job, it will default to the same value of 'SERVER1DEV' as you've defined in the Mananger. You need to change that. Change it from that 'hard coded' value to $PROJDEF which tells DataStage to get the current 'Project Default' value at runtime.

Problem solved.
-craig

"You can never have too many knives" -- Logan Nine Fingers
BIuser
Premium Member
Premium Member
Posts: 238
Joined: Thu Feb 02, 2006 4:03 am
Location: South Africa

Post by BIuser »

Thanks Craig. I understand perfectly now and appreciate your assistance.

I think the only disadvantage of doing it this way is that you are unable to see your data when testing the jobs ... am I right ? (i.e. you cannot see the input/output data coming out of the stages ...)

I suppose the only other way of overcoming this is to upgrade to Version 8.0!

Kindest regards,
Barbara
-------------------------
https://www.ssa.co.za
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not sure what you mean by the 'disadvantage' remark, the Project Default values will be both used in the job and logged in the log for you. And I honestly don't believe that 8.x changes any of this.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pradeepleon
Participant
Posts: 32
Joined: Fri Dec 02, 2005 10:44 pm
Location: Chicago,IL

Re: Environment Variables not reset after export

Post by pradeepleon »

BIuser wrote:I have certain environment variables set up across all three of my environments on the Datastage Server. There is one Datastage server with a development environment, testing environment, QA environment and production environment. When I export jobs to a DSX file from the development environment and then import the DSX file into the Testing environment, the values of the environment variables are not updated to show the new environment. i.e. A variable called DSN=Dev_Example does not automatically get updated to DSN=Test_Example.

Can someone tell me where I can make a change to the settings so that this happens automatically. It's really tiresome having to keep updating the enviroment variables as one moves from environment to environment.

Thanks.
Barbara
To BIuser:

If this helps you.......

Use $PROJDEF(default values defined at Project level in a given environment) as 'parameter value' when you are doing the code migration across environments.And for your testing purposes use the values as defined or given in the environment.

For eg:-

DSN = $PROJDEF(When doing final code migration across environments)

DSN = DEV(For tesing purposes)


As Chulett said......

I believe Version 8.x do not have AI(Artificial Intelligence) in it to anticipate or envision the environmental variable values to be changed automatically to keep it going......
Thanks,
Pradeep

(Ten Hugs And Nine KisseS - THANKS)......is that true?

In GOD we trust,for all others we take cash.
Post Reply