Job parameter values in a job activity stage

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
DSGuru
Participant
Posts: 16
Joined: Fri Feb 15, 2002 4:46 pm

Post by DSGuru »

Adam,
I don't think we can modif parameter value dynamically in job sequencer, and job sequencer doesn't allow to modif its code. So if you must modif the sequencer code, I think you could do the following. Construct your sequencer, then click on "job properties", then click on "Control" tab, highlight and copy the code. Paste that code into a new job, then modif the code to allow your job get parameter dynamically.

Good luck.


Leon
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

There have been lengthy discussions in forums about changing job parameters with the conclusion that it cannot be done. A job parameter is set prior to the job being executed and once that job is running the parameter cannot be changed.

If you need to programmatically set a job parameter in a Sequence job then use a routine stage that returns the value for that parameter. For example if your routine is called GetRunId then you would run it from a routine stage called GetRunId, then link it to Job 2 and in the Job 2 properties set the parameter to GetRunId.ReturnedValue.

regards
Vincent
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

It is a common practice to write a routine from which you call up all your DataStage server jobs. This routine retrieves the parameters for that job from a hash file, database table or text file using the various open file or open table commands available in Universe basic. This lets you set your parameters in a central location and standardise them across jobs.

You can store job name, parameter name and paramater value. You could also just store parameter name and parameter value and use functions to match job parameter names to stored parameter names and set those that match.

Open up your documentation and have a look at the Server Job Developer's Guide Basic Functions such as Openseq and the special DataStage Basic functions such as DSGetJobInfo which can return a list of parameters for the job about to be run and DSSetParam which can reset the value.


Vincent McBurney
Data Integration Services
www.intramatix.com
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Had a quick look for some sample code for you, have a look in DataStage Manager under Routines/SDK/Utility. The UtilityHashLookup shows you how to open a hash file and retrieve a value in a routine. UtilityRunJob shows you how to retrieve parameter values and run a job. You can use this sample code to build your own routine.


Vincent McBurney
Data Integration Services
www.intramatix.com
Post Reply