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.
Dig Deeper on Systems Management Tools
Related Q&A from Dan Reusche
One Search400.com member writes, "Why are the locked objects shown as addresses only and not by name, library and type?" Continue Reading
One Search400.com member writes, "I have two i5/520 systems, each with its own HMC. The i5's are located two miles apart. What I'd like to do is ... Continue Reading
One Search400.com member writes, "What does the QDBSRVnn job do?" Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.