Page 1 of 1

Pass a job level parameter at command line for running a job

Posted: Thu Mar 20, 2008 9:17 am
by vipson
Hello again.

Again, I am trying to set some standards at my job.

Here is the case:
I have bunch of parameters for a job. Parameters would be for odbc connections (db connection, user id, password). This job is generic, means that I will be calling this job at command line for different databases.
Is there any way I can pass the job level parameters at command line so that it knows which db to connect to using what id and password?

We don't want to put this info (db, id, pass) in parameter due to security reason. I agree, that would be a way to do it. But we are required to encrypt the id/pass....

All your suggestions are helpful...

Thanks in advance.

Posted: Thu Mar 20, 2008 10:01 am
by DSguru2B
Sure. Look at the dsjob command that runs the job via command line. -param option is used to specify parameter values during run time.

Posted: Thu Mar 20, 2008 1:06 pm
by vipson
Well...I want to pass the name of the parameter that is defined in the job.

Posted: Thu Mar 20, 2008 2:00 pm
by deanwalker
You pass the name and value to dsjob: -param param=value

But this will not satisfy your requirement to hide the values.
In an 8.x ParameterSet, the values can be passed from a ParameterValue file, but still not hidden as you require.
Is there a problem with the encryption DataStage uses for passwords ?

Posted: Thu Mar 20, 2008 4:55 pm
by ray.wurlod
You can use encrypted environment variables as job parameters.

Posted: Thu Mar 20, 2008 9:26 pm
by vipson
We are using encrypted values in parameters.

We have about 25 sources and few targets. We have designed a job that we want to run on each source and a target. That way we have only one job to maintain. Now I want to call the job/run the job at command line using the parameters (command line paramters) that will tell the job which job level parameter (like data connection, user id, password).
Did I explain better/confused you guys again? Hope not..

Posted: Thu Mar 20, 2008 9:48 pm
by ray.wurlod
Set the encrypted environment variable in the Administrator.
Set up the job parameter so that its default value is the special token $PROJDEF - this tells DataStage to use the project value you set up in the Administrator.
Don't mention the job parameter in your dsjob command.

Posted: Fri Mar 21, 2008 7:06 am
by chulett
Still a little lost on exactly what part you are having problems with. :?

Are you just trying to find out the parameter names in use in any given job from the command line? You can use 'dsjob' with the '-lparams' option. Do you need the values associated with any given parameter? Then the '-paraminfo' option with the found parameter name(s).

Then your script can take that information and whatever it is you need to do with it to build a proper command string.