Page 1 of 1

Job control for reset all jobs

Posted: Thu Mar 11, 2004 2:59 pm
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

Posted: Thu Mar 11, 2004 3:18 pm
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,

Posted: Thu Mar 11, 2004 6:37 pm
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

Posted: Fri Mar 12, 2004 12:07 am
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.

Posted: Fri Mar 12, 2004 12:18 am
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)

Posted: Fri Mar 12, 2004 10:59 am
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.