Job Parameters Vs Environment variables

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
Dsnew
Participant
Posts: 90
Joined: Tue Apr 19, 2005 2:08 pm

Job Parameters Vs Environment variables

Post by Dsnew »

A few doubts..

What is the difference between Job Parameters and Environment variables?
Is it just a scope thing or is there more to it?
Is it better to use Environmental variables to Job Parameters if you use same parameters very often?
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

I personally don't like environment variables because when developing the jobs the "View Data" capability is severely limited. You can use defaults embedded in the job. It just makes life more difficult.

It's a good thing if you're not using hardcoded values for things like credentials and paths, but it also should be friendly to development. I like a good parameter based job control, which could access the environment and then propagate values to the jobs it controls, meaning only the master controlling job, like a Sequence or Batch, has to access the environment. It makes life easier.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: Job Parameters Vs Environment variables

Post by gateleys »

I prefer using Environment variables for parameters that do not change often, viz. DSN, username, password, paths, SMTP, email, etc. However, when there are downstream jobs whose execution depend/based on some previous job's status/output (meaning, the parameter values are highly dynamic), it is wise to use job parameters. And like Kenneth put it, get those values at the Master level and propagate them to subsequent jobs and subsequences.

Oh yes! I have the luxury of version 7.5.1, so View Data is not a problem with $PROJDEF.

gateleys
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Re: Job Parameters Vs Environment variables

Post by kcbland »

gateleys wrote: Oh yes! I have the luxury of version 7.5.1, so View Data is not a problem with $PROJDEF.
Yeah but it sucks if your desired directories are not the current project defaults. You have to keep overriding the $PROJDEF fr every stinking parameter if you can't change the project defaults. It's a pain if you have a development team each mucking around in the same directories and such. Sure for database credentials, but even then you may be pointing elsewhere for dev purposes.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Dsnew
Participant
Posts: 90
Joined: Tue Apr 19, 2005 2:08 pm

Post by Dsnew »

Kenneth and Gateleys,

Thanks for your inputs, could you throw more light on $PROJDEF.
Is there a list of General Environment Variables?
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Go into the Administrator and click Environment in the General tab and you should be able to see different kind of environment variables(General, Parallel and User-defined). A quick search through the help in DataStage will give you a good idea about environment variables and $PROJDEF and other special values you can specify for the value of the environment variable.

HTH
Kris

Where's the "Any" key?-Homer Simpson
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

I had some success where the Sequence job layers used project specific environment variables and the parallel jobs used normal job parameters. The parameters had the same name, just the $ removed from the parallel jobs. The sequence jobs mapped the $ parameters to the normal parameters. This let the developer unit test the job with a persistent set of parameter values.

You can also use environment variable parameters and set the values within jobs to whatever you want and then set them all to $PROJDEF when they are mirated to a new environment.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

I like to do everything via job parameters. Not like to mess with environment variables. No special reason, just a person choice.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kommven
Charter Member
Charter Member
Posts: 125
Joined: Mon Jul 12, 2004 12:37 pm

Post by kommven »

Think about changing parameter based on Environment.
Yes, I agree its purely a Scope.
But again, its depends on your creativity...
Post Reply