job control
Moderators: chulett, rschirm, roy
job control
Hi
How to write a Job Control Routine?.From any server job can we control other jobs?
pls explain
thanks,
naren
How to write a Job Control Routine?.From any server job can we control other jobs?
pls explain
thanks,
naren
Go into DataStage Director. From the menu, do Tools --> Batch ---> New.
This opens a dialog box that allow you to create a "Batch" type job. From the Add Job pull down box, experiment and choose a job. You will see job control logic appear in your properties box. Press the Close button and the job will compile. These jobs will appear in Director under the names "Batch::...".
Look at the logic that was created in the job by opening it again. Tools --> Batch ---> Open. You can add as many jobs as you want, customize the logic, etc. Eventually, you will take the standard instructions for running a job, and put them in your own DS Manager Function. You will be able to write more complete and comprehensive job control yourself, using the document DS* APIs in your DS BASIC manual.
This opens a dialog box that allow you to create a "Batch" type job. From the Add Job pull down box, experiment and choose a job. You will see job control logic appear in your properties box. Press the Close button and the job will compile. These jobs will appear in Director under the names "Batch::...".
Look at the logic that was created in the job by opening it again. Tools --> Batch ---> Open. You can add as many jobs as you want, customize the logic, etc. Eventually, you will take the standard instructions for running a job, and put them in your own DS Manager Function. You will be able to write more complete and comprehensive job control yourself, using the document DS* APIs in your DS BASIC manual.
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
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
Job control allows you to run different jobs, kinda like a job sequencer. The plus of using job control is that you can run loops for a specific job, specifying different inputs via job parameters. Say, you had several source files but you want to apply the same mapping or transformation to each one of the sources. You could use job control to run the same job several times (once for each source file by changing the job parameters in the job control code).
I'm still quite new to datastage, but I don't believe this can be done in a job sequencer unless you make a job for each source file (can be tedious).
I'm still quite new to datastage, but I don't believe this can be done in a job sequencer unless you make a job for each source file (can be tedious).
Ohayo gozaimasu. The Sequencers graphical metaphor basically requires an icon per job controlled. This works well for just a few jobs in a jobstream. But, 300 jobs in a jobstream is unmanageable, unless you begin layering Sequencer jobs over Sequencer jobs in a nested structure. You're better off writing intelligent job control in the long run to do the things you want done.bchau wrote: I'm still quite new to datastage, but I don't believe this can be done in a job sequencer unless you make a job for each source file (can be tedious).
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
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
You can do anything. There are documented APIs to lock, set, and run jobs according to the methods you want. Do you want to read a file, get a list of jobnames to run, run those jobs, send emails letting people know jobs are done, compress and cleanup your work area? All it takes is planning what you want to do, drawing up a technical specification, coding a Batch job with supporting Functions that utilize the DS BASIC job control APIs, and then writing your operational procedures.
Anything is possible, you need to decide what you want to do.
Anything is possible, you need to decide what you want to do.
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
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
Exactly. Thats what i want to do?.Can you help to implement that logic Ken?If possible can you give me some sample code please.
Thanks,
Naren
Thanks,
Naren
kcbland wrote:You can do anything. There are documented APIs to lock, set, and run jobs according to the methods you want. Do you want to read a file, get a list of jobnames to run, run those jobs, send emails letting people know jobs are done, compress and cleanup your work area? All it takes is planning what you want to do, drawing up a technical specification, coding a Batch job with supporting Functions that utilize the DS BASIC job control APIs, and then writing your operational procedures.
Anything is possible, you need to decide what you want to do.
You can see sample code by just simply clicking on "Job properties". Choose the "job control" tab. Select a job on the drop down menu and then click add job. It automatically generates the code for you for that specific job. To add your own code....it all depends what you want to do. You use Basic language to code what you want to do. If you want to loop the job, you use the Basic for loop ie)naren6876 wrote:Exactly. Thats what i want to do?.Can you help to implement that logic Ken?If possible can you give me some sample code please.
FOR I 1 to 3
[some code to do something]
NEXT I
Refer to the Ascential Datastage Basic Guide for code syntax.
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
You will find a few sample routines already in your project. Using DataStage Manager look in the Routines - SDK folder for some samples provided by Ascential. You will also find a heap of sample code on this site by searching for terms such as dsattachjob.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: