[IBM i]

Configuring work management examples on IBM i

Use this information to learn how you can change and create IBM® MQ job descriptions to change the runtime attributes of IBM MQ jobs.

The key to the flexibility of IBM MQ work management lies in the two-tier way that IBM MQ searches for job descriptions:
  • If you create or change job descriptions in a queue manager library, those changes override the global job descriptions in QMQM, but the changes are local and affect that particular queue manager alone.
  • If you create or change global job descriptions in the QMQM library, those job descriptions affect all queue managers on the system, unless overridden locally for individual queue managers.
  1. The following example increases the priority of channel control jobs for an individual queue manager.
    To make the repository manager and channel initiator jobs, AMQRRMFA and RUNMQCHI, run as quickly as possible for queue manager TESTQM, carry out the following steps:
    1. Create local duplicates of the QMQM/QMQMJOBD job description with the names of the IBM MQ processes that you want to control in the queue manager library. For example:
      
      CRTDUPOBJ OBJ(QMQMJOBD) FROMLIB(QMQM) OBJTYPE(*JOBD) TOLIB(QMTESTQM)
      NEWOBJ(RUNMQCHI)
      CRTDUPOBJ OBJ(QMQMJOBD) FROMLIB(QMQM) OBJTYPE(*JOBD) TOLIB(QMTESTQM)
      NEWOBJ(AMQRRMFA)
      
    2. Change the routing data parameter on the job description to ensure that the jobs use the QMQMRUN20 class.
      
      CHGJOBD JOBD(QMTESTQM/RUNMQCHI) RTGDTA('QMQMRUN20')
      CHGJOBD JOBD(QMTESTQM/AMQRRMFA) RTGDTA('QMQMRUN20')
      
    The AMQRRMFA and RUNMQCHI jobs for queue manager TESTQM now:
    • Use the new local job descriptions in the queue manager library
    • Run with priority 20, because the QMQMRUN20 class is used when the jobs enter the subsystem.
  2. The following example defines a new run priority class for the QMQM subsystem.
    1. Create a duplicate class in the QMQM library, to allow other queue managers to access the class, by issuing the following command:
      
      CRTDUPOBJ OBJ(QMQMRUN20) FROMLIB(QMQM) OBJTYPE(*CLS) TOLIB(QMQM)
      NEWOBJ(QMQMRUN10)
      
    2. Change the class to have the new run priority by issuing the following command:
      
      CHGCLS CLS(QMQM/QMQMRUN10) RUNPTY(10)
      
    3. Add the new class definition to the subsystem by issuing the following command:
      
      ADDRTGE SBSD(QMQM/QMQM) SEQNBR(8999) CMPVAL('QMQMRUN10') PGM(QSYS/QCMD)
      CLS(QMQM/QMQMRUN10)
      
      Note: You can specify any numeric value for the routing sequence number, but the values must be in sequential order. This sequence number tells the subsystem the order in which routing entries are to be searched for a routing data match.
    4. Change the local or global job description to use the new priority class by issuing the following command:
      
      CHGJOBD JOBD(QMQMlibname/QMQMJOBD) RTGDTA('QMQMRUN10')
      

      Now all the queue manager jobs associated with the QMlibraryname use a run priority of 10.

  3. The following example runs a queue manager in its own subsystem
    To make all the jobs for queue manager TESTQM run in the QBATCH subsystem, carry out the following steps:
    1. Create a local duplicate of the QMQM/QMQMJOBD job description in the queue manager library with the command
      
      CRTDUPOBJ OBJ(QMQMJOBD) FROMLIB(QMQM) OBJTYPE(*JOBD) TOLIB(QMTESTQM)
      
    2. Change the job queue parameter on the job description to ensure that the jobs use the QBATCH job queue.
      
      CHGJOBD JOBD(QMTESTQM/QMQMJOBD) JOBQ(*LIBL/QBATCH)
      
      Note: The job queue is associated with the subsystem description. If you find that the jobs are staying on the job queue, verify that the job queue definition is defined on the SBSD. Use the DSPSBSD command for the subsystem and take option 6, Job queue entries.
    All jobs for queue manager TESTQM now:
    • Use the new local default job description in the queue manager library
    • Are submitted to job queue QBATCH.
    To ensure that jobs are routed and prioritized correctly:
    • Either create routing entries for the IBM MQ jobs in subsystem QBATCH, or
    • Rely on a catch-all routing entry that calls QCMD, irrespective of what routing data is used.

      This option works only if the maximum active jobs option for job queue QBATCH is set to *NOMAX. The system default is 1.

  4. The following example creates another IBM MQ subsystem
    1. Create a duplicate subsystem in the QMQM library by issuing the following command:
      
      CRTDUPOBJ OBJ(QMQM) FROMLIB(QMQM) OBJTYPE(*SBSD) TOLIB(QMQM) NEWOBJ(QMQM2)
      
    2. Remove the QMQM job queue by issuing the following command:
      
      RMVJOBQE SBSD(QMQM/QMQM2) JOBQ(QMQM/QMQM)
      
    3. Create a new job queue for the subsystem by issuing the following command:
      
      CRTJOBQ JOBQ(QMQM/QMQM2) TEXT('Job queue for IBM MQ Queue Manager')
      
    4. Add a job queue entry to the subsystem by issuing the following command:
      
      ADDJOBQE SBSD(QMQM/QMQM2) JOBQ(QMQM/QMQM2) MAXACT(*NOMAX)
      
    5. Create a duplicate QMQMJOBD in the queue manager library by issuing the following command:
      
      CRTDUPOBJ OBJ(QMQMJOBD) FROMLIB(QMQM) OBJTYPE(*JOBD) TOLIB(QMlibraryname)
      
    6. Change the job description to use the new job queue by issuing the following command:
      
      CHGJOBD JOBD(QMlibraryname/QMQMJOBD) JOBQ(QMQM/QMQM2)
      
    7. Start the subsystem by issuing the following command:
      
      STRSBS SBSD(QMQM/QMQM2)
      
    Note:
    1. You can specify the subsystem in any library. If for any reason the product is reinstalled, or the QMQM library is replaced, any changes you made are removed.
    2. All the queue manager jobs associated with the QMlibraryname now run under subsystem QMQM2.