TechTalk: Altering Run Priority of Submitted Jobs

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Not all jobs are created equal, and there are cases when you'd like to force a job you just submitted to batch to run at a different priority or time slice than the default values. Unfortunately, the SBMJOB command cannot accept override values for either the priority or the time slice. You could start the WRK-SBSJOB SBS(QBATCH) command at a terminal and have a humanoid, in the sitting position, repeatedly press F5 all day long to catch newly submitted jobs, and change them with the Change Job (CHGJOB) command to RUNPTY(60). However, this avenue is too expensive (it requires three full-time employees to cover around-the-clock operations). For-tunately, there's a better way.

1. Create a new class object (type *CLS), QBATCH60, that assigns a priority of 60 and a time slice of 4000 (for example):

 CRTDUPOBJ OBJ(QBATCH) + FROMLIB(QGPL) + OBJTYPE(*CLS) + TOLIB(QGPL) + NEWOBJ(QBATCH60) CHGCLS CLS(QGPL/QBATCH60) + RUNPTY(60) + TIMESLICE(4000) 

2. Add a routing entry to subsystem QBATCH that forces the system to use the new class object when the appropriate routing data is submitted with the new job:

 ADDRTGE SBSD(QGPL/QBATCH) + SEQNBR(9000) + CMPVAL(RUNPTY60) + PGM(QSYS/QCMD) + CLS(QGPL/QBATCH60) 

From now on, all you need to do is include RTGDTA(RUNPTY60) in the SBMJOB command whenever you submit a job to a job queue that is attached to subsystem QBATCH. If you need to use the new class code when submitting jobs to job queues that are attached to other subsystems, repeat step 2 for each subsystem.

For example, suppose you want to run DSPLIB LIB(QSYS) OUT- PUT(*PRINT). Since QSYS contains so many objects, DSPLIB will probably take a long time and consume many system resources. Then you decide to use priority 60 and a time slice of 4000 milliseconds:

 SBMJOB CMD(DSPLIB LIB(QSYS)) + JOB(DSPQSYS) + JOBQ(QBATCH) + RTGDTA(RUNPTY60) 

When the system picks up this job from the job queue, it goes through the routing entries and realizes that there's an entry with a matching compare value of 'RUNPTY60.' The routing entry references a class object, so it is used to set the run-time attributes for the job (priority 60 and time slice 4000).

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: