Page 1 of 1

Environment Variables not reset after export

Posted: Wed Jun 04, 2008 4:37 am
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

Re: Environment Variables not reset after export

Posted: Wed Jun 04, 2008 5:21 am
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.

Re: Environment Variables not reset after export

Posted: Wed Jun 04, 2008 5:27 am
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 ?

Posted: Wed Jun 04, 2008 6:24 am
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.

Posted: Wed Jun 04, 2008 7:32 am
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 ?

Posted: Wed Jun 04, 2008 7:57 am
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.

Posted: Wed Jun 04, 2008 8:36 am
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

Posted: Wed Jun 04, 2008 9:04 am
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.

Re: Environment Variables not reset after export

Posted: Thu Jun 05, 2008 9:16 am
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......