Job control for reset all jobs

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
auvray.muriel
Participant
Posts: 43
Joined: Wed Feb 19, 2003 7:17 am
Location: France - Paris
Contact:

Job control for reset all jobs

Post by auvray.muriel »

Hello,

We use the DSMakereport function to manage a report at the end of each treatment.

The problem is that after the first loading, if a job did not turn, the report returns the last status of the job.
I will thus wish to make a job control which will make a reset of all the jobs before each treatment.

I can do it with the order "dsjob", but I want to do it for a whole list of job, and in a job control.

Can somebody indicate to me how to make?

Regards
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
well as you can get the list of jobs via DSGetProjectInfo (DSJ.JOBLIST) in any job controll, then after Attaching each job from the list (and checking attach was ok) you can simply use the DSRunJob(..) to reset it.
use the designer's help for syntax.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I would not recommend this but here it is.

Code: Select all

open "DS_JOB" to DsJobs else stop
SELECT DsJobs
loop while readnext JobName
  execute 'DSD.RUN ':JobName:' -2'
repeat
Mamu Kim
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

The dsjob executable is your gateway to everything you need to do. It is a command line executable, so you can use the switch to list all jobs in a project. Then, you can cycle thru all jobs and issue the reset command. All of this is available from the system command prompt in both Unix and Windoze.

If you want to do this in DS BASIC, use a Batch job and read the DS* APIs in your manuals to see the same APIs that dsjob uses. You again can get a list of all jobs in a project, then issue the reset API for each job.
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 »

If you're looking for a niche market and you think it would sell, the DataStage API is C-callable, so you could create a little C application! 8)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

All these work in VB as well. It is a little more tricky though. I could give out code examples. I almost always call my own BASIC subroutines instead of the API routines directly.
Mamu Kim
Post Reply