Page 1 of 1

Job Parameters Vs Environment variables

Posted: Tue Aug 22, 2006 11:41 am
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?

Posted: Tue Aug 22, 2006 12:12 pm
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.

Re: Job Parameters Vs Environment variables

Posted: Tue Aug 22, 2006 1:48 pm
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

Re: Job Parameters Vs Environment variables

Posted: Tue Aug 22, 2006 3:20 pm
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.

Posted: Tue Aug 22, 2006 3:44 pm
by Dsnew
Kenneth and Gateleys,

Thanks for your inputs, could you throw more light on $PROJDEF.
Is there a list of General Environment Variables?

Posted: Tue Aug 22, 2006 4:13 pm
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

Posted: Tue Aug 22, 2006 6:57 pm
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.

Posted: Tue Aug 22, 2006 7:02 pm
by DSguru2B
I like to do everything via job parameters. Not like to mess with environment variables. No special reason, just a person choice.

Posted: Tue Aug 22, 2006 7:35 pm
by kommven
Think about changing parameter based on Environment.
Yes, I agree its purely a Scope.
But again, its depends on your creativity...