Q
Problem solve Get help with specific problems with your technologies, process and projects.

Using subsystems to run job queues

We would like to see certain programs run in one job queue so that the program wouldn't be running several instances at the same time, which can cause problems in our data. We have job queues allocated to users divided by area and by the type of work. The job queue above should be supplemental. Do you have any idea if this can be done and how to do it?
You can set up a new subsystem to accomplish this, or you can modify an existing subsystem. Let's look at creating a subsystem. To do this, you can use a CRTSBSD command, like the one shown here:

CRTSBSD SBSD(YOURLIB/QBATCHS) POOLS((1 *BASE)) MAXJOBS(1) TEXT('single threaded batch Subsystem')

The MAXJOBS parameter is the key in the above command. You are saying that one job only can be active at a time in this subsystem. Once you have created the subsystem description, you will have to add a class and a routing entry to the subsystem to see that your job is run in this subsystem. Use the CRTCLS and ADDRTGE command, for example:

CRTCLS CLS(DREUSCHE/QBATCHS) RUNPTY(50) ADDRTGE SBSD(DREUSCHE/QBATCHS) SEQNBR(1999) CMPVAL('*ANY') PGM(QCMD) CLS(QBATCHS)

The help text for the CMPVAL parameter on the ADDRTGE command is: "Specifies a value that is compared with the routing data to determine whether this routing entry is used for starting a routing step for the job. If the routing data matches the routing entry compare value, that routing entry is used." You can put in *ANY or a specific value for the CMPVAL parameter. Let's just use *ANY to keep this simple.

You will also need to add a job queue entry to the subsystem. You can also specify that this job queue has a maximum width of one, as extra insurance, if you like:

ADDJOBQE SBSD(YOURLIB/QBATCHS) JOBQ(YOURLIB/SINGLE) MAXACT(1)

Then, when you want to run jobs in this subsystem, just use the SBMJOB command, like this:

SBMJOB CMD(CALL PGM(PGMA)) JOBQ(YOURLIB/QBATCHS) PGMA is the program you want to call and by specifying the jobq for the single threaded subsystem, only one job can run this program at a time.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: Tips, tutorials and more.

Visit the ITKnowledge Exchange and get answers to your systems management questions fast.

Read this Search400.com Featured Topic: Take control of your iSeries.

Ask the Experts yourself: Our systems management gurus are waiting to answer your technical questions.

This was last published in June 2005

Dig Deeper on Systems Management Tools

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close