Difference between $ENV and $PROJDEF

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
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

Difference between $ENV and $PROJDEF

Post by dodda »

Hi All,

Can anyone tell me the difference between $ENV and $PROJDEF values specifying for the environmental variables.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

$ENV gets the parameter value from the environment (env. wide). $PROJDEF get the value set in the project via the administrator (project wide).
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

Post by dodda »

Thanks DSGuru.

Could you please be more specific. If possible can you explain with an example
Ananda
Participant
Posts: 29
Joined: Mon Sep 20, 2004 12:05 am

Post by Ananda »

Environment variables like APT_CONFIG_FILE are specific for that datastage server on which many projects are running.

Whereas $PROJDEF which is mostly used for passwords is project specific which is set through Administrator.
If you don't fail now and again, it's a sign you're playing it safe.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

When a UNIX process runs it runs in a shell in which there are some shell variables and environment variables defined. Exported environment variables are available to any sub-shells invoked from that shell.

When you run a DataStage job, your shell starts a number of sub-shells. Some of these run uv, uvsh, dssh or osh. Any of these has access to the exported environment variables. The special default value $ENV is an instruction to obtain the actual default value from the exported environment variables available to the shell.

Each DataStage project can have a list of other environment variables defined. These are configured in the Administrator client and stored in the DSParams file for that project. These environment variable values are the ones that are accessed via the special default value $PROJDEF for a job parameter environment variable.

To complete the picture there is a third special value $UNSET which instructs the job to unset the environment variable unless a non-default replacement value is supplied. This is useful for those environment variables that switch on diagnostics/tracing if they are set.
Last edited by ray.wurlod on Sat Apr 10, 2010 3:17 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

Post by dodda »

Thanks ray for the information
Post Reply