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).