Monday, January 31, 2011

DS - Environment Variables

What is an Environment Variable??
Basically Environment variable is predefined variable those we can use while creating DS job.We can set eithere as Project level or Job level.Once we set specific variable that variable will be availabe into the project/job.
We can also define new envrionment variable.For that we can got to DS Admin .

    OR

These are the variables used at the project or job level.We can use them to configure the job i.e., we can associate the configuration file(Wighout this u can not run ur job) increase the sequential or dataset read/ write buffer.

ex: $APT_CONFIG_FILE

Like above we have so many environment variables. go to job properties and click on Paramer tab then click on add environment variable to see most of the environment variables.

***************************
DataStage EE environment variables
The default environment variables settings are provided during the Datastage installation (common for all users).
Users have a few options to override the default settings with Datastage client applications:
# With Datastage Administrator - project-wide defaults for general environment variables, set per project in the Projects tab under Properties -> General Tab -> Environment...
# With Datastage Designer - settings at the job level in Job Properties
# With Datastage Director - settings per run, overrides all other settings and is very useful for testing and debuging.

The Datastage environment variables are grouped and each variable falls into one of categories.
Basically the default values set up during an installation are resonable and in most cases there is no need to modify them.

Environment variables overview

Listed below are only environment variables that are candidates to adjustment in real-life project deployments. Please refer to the datastage help for details on variables not listed here.
General variables
# LD_LIBRARY_PATH - specifies the location of dynamic libraries on Unix
# PATH - Unix shell search path
# TMPDIR - temporary directory
Parallel properties
# APT_CONFIG_FILE - the parallel job configuration file. It points to the active configuration file on the server. Please refer to Datastage EE configuration guide for more details on creating a config file.
# APT_DISABLE_COMBINATION - prevents operators (stages) from being combined into one process. Used mainly for benchmarks.
# APT_ORCHHOME - home path for parallel content.
# APT_STRING_PADCHAR - defines a pad character which is used when a varchar is converted to a fixed length string 

*******************************

Creating project specific environment variables-

Start up DataStage Administrator.- Choose the project and click the "Properties" button.- On the General tab click the "Environment..." button.- Click on the "User Defined" folder to see the list of job specific environment variables.
There are two types of variables - string and encrypted. If you create an encrypted environment variable it will appears as the string "*******" in the Administrator tool and will appears as junk text when saved to the DSParams file or when displayed in a job log. This provides robust security of the value..

Migrating Project Specific Job Parameters. It is possible to set or copy job specific environment variables directly to the DSParams file in the project directory. There is also a DSParams.keep file in this directory and if you make manual changes to the DSParams file you will find Administrator can roll back those changes to DSParams.keep. It is possible to copy project specific parameters between projects by overwriting the DSParams and DSParams.keep files. It may be safer to just replace the User Defined section of these files and not the General and Parallel sections.

Environment Variables as Job Parameters- Open up a job.- Go to Job Properties and move to the parameters tab.- Click on the "Add Environment Variables..." button.- Set the Default value of the new parameter to "$PROJDEF".When the job parameter is first created it has a default value the same as the Value entered in the Administrator. By changing this value to $PROJDEF you instruct DataStage to retrieve the latest Value for this variable at job run time.If you have an encrypted environment variable it should also be an encrypted job parameter. Set the value of these encrypted job parameters to $PROJDEF. You will need to type it in twice to the password entry box.Using Environment Variable Job ParametersThese job parameters are used just like normal parameters by adding them to stages in your job enclosed by the # symbol.
Database=#$DW_DB_NAME#Password=#$DW_DB_PASSWORD#File=#$PROJECT_PATH#/#SOURCE_DIR

No comments:

Post a Comment