Controlling Job Execution

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
pramod_au
Participant
Posts: 30
Joined: Thu Feb 06, 2003 8:30 am
Location: London,UK

Controlling Job Execution

Post by pramod_au »

Hello
I have a list of job designed. I want to have some option mechanism to run these jobs.

Say for example, i have the 5 independent jobs 1 - 2 - 3- 4 - 5
Normally it will execute from 1-5.
In some special case, I want my jobs to execute with option
i.e. job1245 will execute the 1-2-4-5 in sequence

job25 will execute 2-5 in sequence

(i.e. job[options] where options are my individual jobs)

NOTE: No parameter is passed to any of the JOBS.All jobs are mutually exclusive...

Can i Do this OPTION DRIVEN JOB EXECUTION in DATASTAGE?


Pramod
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I don't know how comfortable you are with DS Basic, but what I would do is write a Job Control Batch. Pass in a parameter that indicates the jobs to run - like "1245" in your example. Then in a loop, pull a character off the parameter and run the job it indicates. Very high level, but I hope that makes sense. I'm sure there are other ways, but that was the first thing that popped into my head.

-craig
pramod_au
Participant
Posts: 30
Joined: Thu Feb 06, 2003 8:30 am
Location: London,UK

Post by pramod_au »

Hello
1234 are not parameters!!
I would like to reframe my question. JOB1-JOB2-JOB3-JOB4 are independent jobs!! I want to control the sequence of execution of the above independent jobs.
E.g:
JOB1-JOB2-JOB4
JOB1-JOB4
User can select any of the above 4 jobs and can execute in which ever way he wants!!!
I DONT WANT TO USE JOB SEQUENCER.

Pramod
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Craig was suggesting you provide a parameter to the controlling job (sequence) to specify to it which jobs to run and in which order.
The controlling job, therefore, has a parameter and the user enters a number indicating the job execution order. Job control code then decodes this number into correctly-ordered execution of the independent jobs.

. * List of possible job names
. JobList = "JOB1;JOB2;JOB3;JOB4;JOB5"

. * Number entered by user, for example 1245
. UserList = DSGetParamInfo(DSJ.ME, "JobsToRun", DSJ.PARAMVALUE)

. UserCount = Len(UserList)
. For JobNo = 1 To UserCount
. JobInd = UserList[JobNo,1]
. If 1
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Exactly! Thanks for the clarification. I didn't have time to write up an example yesterday morning but you are spot on, as usual. [:D]

-craig
Post Reply