Page 1 of 1

specifying parameter SET via dsjob?

Posted: Mon Aug 13, 2007 6:45 pm
by val
I'm trying to run DataStage jobs from the command-line using dsjob. Works fine, except for jobs that have parameter sets. Does anyone know if and how I can specify a particular parameter set in the dsjob arguments? Or must I specify each of the params in the set explicitly?

To illustrate: I have a job that takes a DSN, username and password. In the job design I created three params, and then created three parameter sets called "dev", "test" and "prod". In each set, the DSN name, username and password have different values. I also have an optional "email" parameter, not part of the sets -- the user can enter a value here to get notified on job completion.

When I run the job from Designer or Director, I'm prompted to select a parameter set, and a value for the email param, and all works fine. But when I run from dsjob, I can specify -param email=foo@bar.com, but I can't figure out how to tell dsjob to specify the dev or test or prod param set.

Do I need to explicitly set all the params in the parameter set from the command-line?

Thanks!

- Val

Posted: Mon Aug 13, 2007 9:59 pm
by chulett
Unless they've specifically added that 'parameter set' option to the command line, you'll need to specify each individually. Check the documentation or type dsjob -run and check the usage statements.

I don't have 8 dot anything so can't check myself.

Posted: Tue Aug 14, 2007 10:28 am
by val
I think you're probably correct -- the dsjob docs don't say anything about a param set option, and trying to use the param set name as a param:

-param <paramsetname>=<value>, like
-param DSNParamSet=dev

doesn't work.

This would suck -- I don't want to specify e.g. production passwords on the commandline (I don't even want to KNOW the production passwords!), I want to invoke a stored setting. I've opened a ticket with IBM... I'll update y'all on what they say.

Any other way around this?

- Val

Posted: Tue Aug 14, 2007 4:49 pm
by gomez
Well, we just got a reply from IBM, and it does indeed work -- just misspelled the param set name.

To be clear:

In order to specify a parameter set as an option to dsjob, use

Code: Select all

-param <parameter_set_name>=<value_file_name>
If you have a job "test_job" in a project "test_project" that takes a parameter set named "foo_params" with value files named "dev", "test" and "prod", the dsjob invocation looks like

Code: Select all

dsjob -run -param foo_params=dev test_project test_job
Enjoy!

Posted: Tue Aug 14, 2007 5:21 pm
by chulett
Good to know! Time to mark this as Resolved it seems.

Posted: Wed Aug 22, 2007 3:01 am
by Abhijeet1980
Hello Everybody,

What if the no of parameters are more ...Say about 20 - 25 odd.

Bcos of the limitation from the OS end (UNIX/Solaris in our case), there has to be some other alternative for the same. :(

I've been suggested by our colleagues that we do go for the Routine which would read a text file containing the parameters and using SETPARAM set all parameter values. :D

Any alternative answer would be really appreciated .....

Thanks
Abhijit

Posted: Wed Aug 22, 2007 6:16 am
by kduke
We do all this in a shell script. Works fine.

Posted: Wed Aug 22, 2007 6:37 am
by chulett
Abhijeet1980 wrote:What if the no of parameters are more ...Say about 20 - 25 odd.
And you can't let any of them default? :?

As Kim notes, you can script this. Or use something like Ken Bland's Job Control Utilities.