Controlling the quantity of jobs running

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
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Controlling the quantity of jobs running

Post by gpbarsky »

Hi.

How can I control the quantity of job that are triggered in the Director ?

I've built a process that has the ability of triggering several jobs at the same time, but I want to control the quantity of jobs that are running simultaneously.

Does anyone know how to do this ?

Thanks in advance.
[8)]
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You do this in code.
Create a job sequence and compile it, and observe how it maintains arrays of information about jobs that are running.
You can count the number of items in such an array (whether you create your own or use one created by a job sequence) in order to determine whether to start any more jobs. (Then what do you do?)


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

gpbarsky

If you are on UNIX then you can shell out and do a

ps -ef | grep jobname

if they are all the same job. This is a little tougher if you are on Windows. You could probably run a TCL command LIST.READU EVERY or PORT STATUS. If you need exact syntax then email me.

Thanks Kim.

Kim Duke
DwNav - ETL Navigator
www.Duke-Consulting.com
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post by gpbarsky »

Kim:

I am refreshing this topic because I need this solution. I thought there is a command (within DS BASIC) that stores all the job handlers that I am running.

In summary, I need a way to control the quantity of running jobs. I don't have the paralell extender. I just have DS 5.2, and myself.

Thanks in advance.


Guillermo P. Barsky
Buenos Aires - Argentina
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Guillermo

Ray's way requires all of the jobs to be kicked off from one batch job. It is very easy that way. You can do the same thing in a sequence by creating sequences to slow things down. Have 5 jobs point to a sequence and wait for these to finish before starting the next set of jobs. If you want the ps version then it would look something like this.



MyLimit = 5
JobName = "MyJob"
Cmd = 'SH -c "ps -ef | grep ':JobName:' | grep -v grep | wc -l"'
execute Cmd capturing OutRec
NoOfProcesses = OutRec + 0
if NoOfProcesses
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post by gpbarsky »

Kim:

Thank for your answer, but I don't understand what it does.

First of all, I am running the DS on a Windows 2000 platform. I don't have a Unix system.

As you said in your note, it is the same for me to control a "set of jobs". For example, to run 5 jobs and when the last is finished the I can run another set of 5 jobs.

I remember that there is a BASIC sentence that holds all the job handlers that I pass to it. Do you know this name ? Or do you have another method to control the quantity of running jobs ?

Thanks again.

[:)][:)][:)][:)][:)]

Guillermo P. Barsky
Buenos Aires - Argentina
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Guillermo

You can do it in a batch job. A batch job is a job with no stages. All it has is code. It only runs other jobs. If you go into the code section there is a drop down list of jobs. If you select a job and tell it to add the job then it will insert the code to run that job. If you take the wait for job routines and place them together at the bottom then all those jobs will run at the same time. Next start your next group or as one job finishes then start a new one.

It is easy you can figure it out.

Kim.

Kim Duke
DsWebMon - Monitor DataStage over the web
www.Duke-Consulting.com
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

(Advertising, perhaps)

If you can't figure it out you can create a specification of exactly what you want it to do and hire a competent consultant to create the job control code for you.
There are several competent consultants who post on this forum and elsewhere.

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
msigal
Participant
Posts: 31
Joined: Tue Nov 26, 2002 3:19 pm
Location: Denver Metro

Post by msigal »

What if you have multiple users and many, many jobs that could be run? Is there a way to setup the server to que up jobs that users kick off so one doesn't have to always submit a job through a controller? We wouldn't want to set up another layer like that with as many jobs as we have and each with the potential to have various job parameters.

We're running 5.2.2 on AIX.

Thanks,
Myles
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Myles

You would have to create a process to run all the jobs. You could do this in BASIC. Append the job and the parameter values to a sequential file and run these jobs 5 or 6 at a time or whatever. As one job finishes then start the next one in the list. Should be easy to write.

Kim.

Kim Duke
DsWebMon - Monitor DataStage over the web
www.Duke-Consulting.com
msigal
Participant
Posts: 31
Joined: Tue Nov 26, 2002 3:19 pm
Location: Denver Metro

Post by msigal »

We do something similar to what you suggest, but there are restrictions on its use. We currently have a auto-conversion process in place that detects the receipt of a file and kicks off an associated job. It uses a web interface and is written in java using DataStage API. It has an internal control that keeps track of how many jobs it has running and in que, but doesn't check the server to see how many total jobs are running. This process requires some set up, but becomes fully automated after setup. I was hoping for some sort of ini file or the like on the server side that we could set a limit, but it doesn't sound like that's an option.

Thanks for info.

Myles

Myles Sigal
Technical Analyst
Thomson - Medstat
777 E. Eisenhower - 435B
Ann Arbor, MI 48108

myles.sigal@medstat.com
734-913-3466
Post Reply