Running Jobs from Routines

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
goosarikiran
Participant
Posts: 9
Joined: Tue Jul 26, 2005 11:12 pm
Location: Bangalore

Running Jobs from Routines

Post by goosarikiran »

Can we run jobs from Routines?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Yes, you can run jobs easily from routines.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Sorry, I was being a typical consultant - I answered your question but didn't help you at all :D

You need to use DataStage routines to call jobs from routines.

1. DSAttachJob() to "open" the job for use
2. DSPrepare() [optional] to prepare a perhaps aborted job
3. DSSetParam() [optional] to set parameter values
4. DSRunJob() to actually run the DataStage job
5. DSWaitForJob() [optional] to wait for the job to complete

There are other routines which you might want to use, but these are the normal ones. The Basic Programmer's guide will describe all of these routines in detail.

If you wish an example, create a Sequencer and do one job activity. Then in the Director look at the Job Control tab to get an example of how these calls work.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

There is a routine supplied by IBM to do it. UtilityRunJob.
Mamu Kim
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

You have Enterprise Edition of DataStage, and you probably work in parallel jobs, you use the Parallel Job Developers Guide to build those jobs. Ascential have cunningly hidden job control documentation in the Server Job Developers Guide, even though it pertains to all job types and not just server jobs. Open up the Server Job Developers Guide and peruse the chapter on BASIC programming, especially the section on job control.

An even easier way to work it out is to create a batch job. These old dinosaurs are created from the Director Tools - Batch menu and they come with a combo box that lists all jobs, when you choose a job and hit the "Add Job" button it dumps all the code into the code box for running the job. You can then copy and paste it to a routine and modify it to make it more generic.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Ascential have cunningly hidden job control documentation in the Server Job Developers Guide
That's because a job sequence is just a special case of a server job. :D
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply