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

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
vipson
Premium Member
Premium Member
Posts: 52
Joined: Thu Jan 03, 2008 10:31 pm

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

Post 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.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
vipson
Premium Member
Premium Member
Posts: 52
Joined: Thu Jan 03, 2008 10:31 pm

Post by vipson »

Well...I want to pass the name of the parameter that is defined in the job.
deanwalker
Participant
Posts: 82
Joined: Tue Jan 22, 2008 10:37 am
Location: UK

Post 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 ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can use encrypted environment variables as job parameters.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vipson
Premium Member
Premium Member
Posts: 52
Joined: Thu Jan 03, 2008 10:31 pm

Post 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..
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply