Page 1 of 1

How to get Project's Environment variable.

Posted: Thu Jun 10, 2004 9:09 am
by Ravindar
Hi all,

I want to get a list of Environment variable used in a project without using administrator.

Say I have enough access to go into that UV account. Then in what way can I get that list.

Thanks in advance.

Posted: Thu Jun 10, 2004 4:49 pm
by dstechdev
One way is to open the job properties of a job, click on Parameters then click on Add Environemnt Varaible in the lower right hand corner


John F.

Posted: Thu Jun 10, 2004 4:57 pm
by ketfos
Hi,
There is a file

dsenv

which sets up envirornmental variables for datastage.
By default it is set in dshome/DSEngine directory but can be in a different path. You can read this as seqential file in a datastage job and find out different environmental variables set like

DS_MMAPPATH=/tmp; export DS_MMAPPATH
DS_MMAPSIZE=32; export DS_MMAPSIZE
DS_MAXWRITEHEAPS=1; export DS_MAXWRITEHEAPS
ODBCINI=$dshome/.odbc.ini; export ODBCINI
HOME=${HOME:-/}; export HOME

#UDTHOME=$dshome/../ud41; export UDTHOME

Ketfos

Posted: Thu Jun 10, 2004 7:04 pm
by ray.wurlod
Create a job that does anything (even just X = 0 in Job Control will suffice).
Create a before-job subroutine using ExecTCL to execute the ENV command.
The environment variables will appear in the job log.

If you have a recent enough version of DataStage, you don't even need to do this. Each time you run a server job, the first even logged is "starting job", the second event logged is "environment variable settings".

Slight change in my question.

Posted: Thu Jun 10, 2004 10:14 pm
by Ravindar
sorry I want to be more specific that,

I need a list of "UserDefined Environmental variable" of a project from UV command prompt.

Thanks in Advance.

Posted: Thu Jun 10, 2004 11:08 pm
by ray.wurlod
ENV is a TCL-level command that displays all currently-set environment variables. You can also use its long form, ENVIRONMENT. On Windows it is equivalent to the DOS /C set command while on UNIX it is equivalent to the SH -c set command.

There is nothing in the operating system to distinguish whether an environment variable is "user defined" or otherwise, so there is no scope with this command for filtering just for these.

You could, of course, elect to use some form of naming convention for your user-defined environment variables, then filter the output somehow.

The ENV command can also be used to set and to unset environment variables.

Posted: Fri Jun 11, 2004 12:48 am
by Sreenivasulu
You can add/View the enviormental variables from inside the lookup stages (doing a right click on the mapping box->Job Parameter-> Add envirornment variabl) inside the transformer.

Regards

Posted: Fri Jun 11, 2004 7:01 pm
by ray.wurlod
The Lookup stage is for parallel jobs.
The original poster specified server jobs, and the desire to view the value of environment variables from the UV command prompt.

Posted: Mon Jun 21, 2004 2:13 am
by Ravindar
Hi,

The ENV command didn't show me the user defined EV which I created manually in my project.

In my case the purpose of user defined EV which I created is to parameterize the DB connection values.(Say I have created some 20 EV in adminstrator for my project and I used those variables as job parameters in my job.)

Now I need to get a list of such UserDefined EV in each of my project for documentation purpose.

Is there any way to get such list and store it in a file.

Posted: Mon Jun 21, 2004 4:29 pm
by ray.wurlod
It's already stored in the DSParams file on the server (in the project directory). Why not parse from there? There is a separate section for user-defined environment variables, so you can easily capture them, perhaps using a BASIC routine.

Posted: Mon Dec 19, 2005 7:57 pm
by kommven
I believe there is a tool called "DataStage Environment Variable Transporter" for backing up and transferring Env. variables...