Adding A Job Queue To A Batch Subsystem
May 15, 2013 Hey, Joe
I want to add another batch job queue to my QBATCH subsystem for submitting reporting jobs that take a long time to process. I want to put them in their own job queue so they can just chug away in QBATCH without interfering with my other batch work. How do I add another job queue that I can submit these jobs to? –Bob Adding batch job queues to QBATCH is easy. All you have to do is perform the following steps and you’ll be able to create another QBATCH job queue in no time.
Here’s the drill for performing each step. Step #1: Check to see how many jobs your QBATCH subsystem can run at one time and adjust that number, if necessary. Check whether your QBATCH subsystem is constrained regarding the maximum number of jobs it can process at the same time (its “maximum jobs parameter” or MAXJOBS). If QBATCH is configured to run a maximum of four jobs at the same time from four different job queues and you want to change it to accept work (jobs) from a fifth job queue, for example, you will need to change its MAXJOBS value to five. You can check your maximum jobs value for QBATCH by running the following Display Subsystem Description (DSPSBSD) command: DSPSBSD SBSD(QBATCH) Take option 1=Operational Attributes off the Display Subsystem Description menu that appears and you’ll a screen that looks like this. (Click graphic to enlarge.) Check the maximum jobs in subsystem value. This tells you how many batch jobs can run in QBATCH at one time. If this value is equal to*NOMAX, you won’t have to worry about increasing it to run more jobs in your subsystem, because the QBATCH subsystem will immediately run all jobs that are submitted to it from any of its attached job queues (no maximum number of simultaneous jobs). If your maximum jobs in subsystem value is less than the number of jobs you want to simultaneously run in your subsystem, you can change it to your target number of jobs by executing one of these Change Subsystem Description (CHGSBSD) commands.
CHGSBSD SBSD(QBATCH) MAXJOBS(*NOMAX) Or . . . CHGSBSD SBSD(QBATCH) MAXJOBS(number) Where *NOMAX again, allows the subsystem to simultaneously run any number of jobs submitted to it (no maximum). If you specify a specific number of jobs, that number will be the new maximum number of jobs to simultaneously run in your subsystem. After making the change, use the DSPSBSD command to double-check that your changed value is the new number. Step #2: Create the new job queue Creating a new job queue for your QBATCH subsystem is easy. If you want to create a new job queue called REPORTS for example, you would use this Create Job Queue (CRTJOBQ) command. CRTJOBQ JOBQ(QUSRSYS/REPORTS) TEXT('QBATCH job queue for report processing') Step #3: Attach the job queue to the QBATCH subsystem Job queues are attached to a subsystem through job queue entries in the subsystem description. To see the job queue entries associated with your QBATCH subsystem, run the Display Subsystem (DSPSBSD) command again and select option 6, job queue entries, from the Display Subsystem Description menu. You’ll see a screen that looks something like this. (Click graphic to enlarge.) To add your REPORTS job queue to your subsystem right between the FINJOBQ and FINANCE job queues, for example, you can run the following Add Job Queue Entry (ADDJOBQE) command. ADDJOBQE SBSD(QBATCH) JOBQ(QUSRSYS/REPORTS) SEQNBR(15) This will change your job queue entries screen to look like the following: (Click graphic to enlarge.) And now you can submit jobs to the REPORTS job queue and they will run in QBATCH. If two or more job queues have jobs waiting to run at the same time, jobs are accepted into QBATCH from the job queues with the lowest job queue entries first. Since the REPORTS job queue is sequence number 15, jobs submitted to the FASTQ, QBATCH, and FINJOBQ job queues will be started before jobs submitted to REPORTS. This won’t be a problem if your MAXJOBS vale is equal to *NOMAX because QBATCH will run all jobs submitted to its attached job queues. But if you set up your subsystem’s MAXJOBS value to be less than four, QBATCH would have to be running less than three jobs from the three job queues in front of REPORTS for jobs from the REPORTS job queue to be submitted to QBATCH. That’s why it’s important to check and correctly set your subsystem’s MAXJOBS parameter in step 1. And that’s all there is to adding another job queue to the QBATCH subsystem. HTH –Joe Follow Me On My Blog, On Twitter, And On LinkedIn Check out my blog at joehertvik.com, where I focus on computer administration and news (especially IBM i); vendor, marketing, and tech writing news and materials; and whatever else I come across. You can also follow me on Twitter @JoeHertvik and on LinkedIn. Joe Hertvik is the owner of Hertvik Business Services, a service company that provides written marketing content and presentation services for the computer industry, including white papers, case studies, and other marketing material. Email Joe for a free quote for any upcoming projects. He also runs a data center for two companies outside Chicago. Joe is a contributing editor for IT Jungle and has written the Admin Alert column since 2002.
|