passing parameters for dsjob

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
vinodhraj
Participant
Posts: 53
Joined: Mon Sep 12, 2005 6:51 am

passing parameters for dsjob

Post by vinodhraj »

Hi DSGurus,

How to pass parameters for running a job in unix (dsjob -run <<project name>> <<name job name>>)

let say the parameters were located in a table

Thanks

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

Post by kcbland »

Methinks some scripting would come it handy. Perl, ksh, bsh, whatever your preference. :wink:
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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

dsjob -run -param name1=value1 -param name2=value2 -jobstatus project job
It's your choice as to how to get them out of a table, presumably into script (shell) variables.

I'd prefer an approach using a job sequence, but you specified "from the operating system".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
koolnitz
Participant
Posts: 138
Joined: Wed Sep 07, 2005 5:39 am

Post by koolnitz »

You can even store all your parameters in a flat file and pass this file to -param argument.

The format of the parameter file should be:
paramater1=value
parameter2=value
parameter3=value
..
..

And your command would become

dsjob -run -param parameterfile.txt project job
Nitin Jain | India

If everything seems to be going well, you have obviously overlooked something.
sb_akarmarkar
Participant
Posts: 232
Joined: Fri Sep 30, 2005 4:52 am
Contact:

Post by sb_akarmarkar »

Nitin,

I think we cannot use parameter file as you mention.

We can use parameter in following way only as i know..

dsjob -run -param name1=value1 -param name2=value2 project job


Thanks,
Anupam
koolnitz
Participant
Posts: 138
Joined: Wed Sep 07, 2005 5:39 am

Post by koolnitz »

Oh yess..

The command would remain
dsjob -run -param name1=value1 -param name2=value2 project job

Anupam is right that for each parameter used in the job we need to specify in -param argument,
-param name1=value1, name2=value2, ... , namen=valuen

Still we can have a file where we keep all the parameters used in the job, in the format explained in previous post and can use it to pass the value to parameters in the command line, like..

dsjob -run -param name1=$value1 -param name2=$value2 project job, where values to $value1 and $value2 variables are passed from the flat file.

Moreover you can use -lparams option with dsjob command to automate fetching the parameters defined in jobs if you have more than one jobs to run through single script. This way, you facilitate all the jobs to get their parameters' value from a single parameter file.
Nitin Jain | India

If everything seems to be going well, you have obviously overlooked something.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

koolnitz wrote:You can even store all your parameters in a flat file and pass this file to -param argument.

The format of the parameter file should be:
paramater1=value
parameter2=value
parameter3=value
..
..

And your command would become

dsjob -run -param parameterfile.txt project job
Is this documented somewhere? (I don't have access to DataStage at the moment.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
koolnitz
Participant
Posts: 138
Joined: Wed Sep 07, 2005 5:39 am

Post by koolnitz »

Ray, please refer to my last reply on this thread.

dsjob -run -param parameterfile.txt project job is wrong command as pointed out by Anupam.

I am not sure if this format has been documented anywhere, but this is what we are using in many of our projects, and it's working absolutely fine.

We are maintaining multiple such parameter files, and based on the requirement we pass the different parameter file to the script where we kick off DS jobs, and there it passes the values to the job parameters.
Nitin Jain | India

If everything seems to be going well, you have obviously overlooked something.
Post Reply