Page 1 of 1

Posted: Mon Jan 27, 2003 3:52 pm
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

Posted: Mon Jan 27, 2003 4:39 pm
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

Posted: Tue Jan 28, 2003 5:02 am
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

Posted: Tue Jan 28, 2003 5:19 am
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