Tuning work selection criteria

JES2 trace ID 20 tracks the number of output elements each device examines before finding selectable output. Use trace ID 20 records to determine the optimum settings for the WS= parameter. The $TRACE output shows the effect of reordering the work selection list in terms of the amount of time spent and output examined for every queue search.

Table 1 illustrates table eight output groups on the output queues where the only relevant criteria are class, routecde, and priority.

Table 1. Example of output groups on output queues
ROUTECDE A CLASS B C
LOCAL JOE1 JOE3 JOE5
JOE7
R1 JOE2    
R2   JOE4
JOE6
 
R3   JOE8  
The following general guidelines should help you tune your work selection parameters for the best performance. Evaluate these guidelines in regards to your specific environment.
  • Remove irrelevant criteria. Criteria after the slash need not match. If a criterion is not important to you, remove it from the list. In particular, this applies to RJE devices where the only pertinent characteristics might be ROUTECDE (R) and CLASS (Q).
  • Place WRITER (W) first in the list if there is a lot of output for a particular writer. This causes print/punch devices to reject work for a particular writer before examining any other criteria.

    You can improve performance further by keeping electronic mail files in a separate class from other print/punch output. This prevents printers or punches from examining large amounts of mail when selecting work.

  • Always place CLASS (Q) in the WS list. Leaving any criterion out of the list tells JES2 not to consider that criterion when examining output. If CLASS is not in the list, JES2 scans every class queue looking for output which matches all the other characteristics. To limit the number of queues scanned, include CLASS in the WS list, and limit the number of classes specified.

    Using Table 1 as a reference for the output queues, Table 2 illustrates the search results when CLASS is specified and when CLASS is not specified. The column Output groups scanned indicates how many output groups are examined before the device selects one to process. The column Element selected indicates which output group of those examined was selected.

    Table 2. Search results when specifying CLASS
    WS Criteria Order of Selection Output groups scanned Element selected
    WS=(Q,R)
    Q=BC
    R=(R2,Local)
    JOE4
    JOE6
    JOE3
    JOE5
    JOE7
    2
    2
    2
    3
    2
    2
    2
    1
    2
    2
    WS=(R)
    R=(R2,Local)
    JOE4
    JOE6
    JOE1
    JOE3
    JOE5
    JOE7
    4
    4
    6
    5
    4
    3
    4
    4
    1
    2
    3
    3

    In Table 2, JOE1 is selected when WS=(R) is specified because all class queues are examined. JOE1 is not selected when WS=(Q,R) is specified because only queues B and C are examined.

    Assume JOE4 and JOE6 have been selected first because their routecode was a best match. They are longer no longer on the queues.

    When WS=(R) JES2 searches the queue for work as follows:
    • JOE1 has a ROUTECDE=LOCAL which is not a best possible match
    • Starting with CLASS=A
      • JOE2 has a ROUTECDE=R1 which does not match at all
      • Continue searching on next queue
    • Go to CLASS B:
      • JOE3 has a ROUTECDE=LOCAL. It is not the best possible so continue looking
      • JOE8, the ROUTECDE does not match at all
    • Go to CLASS C:
      • JOE5. It is not the best possible and not better than JOE3. Continue searching.
      • JOE7. It is not the best possible and not better than JOE3
    • All JOEs have been examined
    • JOE3 is selected because it is the best one found.
  • Give CLASS (Q) a higher priority than other criteria, particularly ROUTECDE (R). This improves performance by reducing the amount of output examined. When CLASS has a higher priority than ROUTECDE (farther to the left in the list), JES2 prints all eligible work from the first class queue before moving on to the next class. If CLASS has a lower priority, JES2 might unsuccessfully search every class queue, and possibly every output element, looking for a perfect match.

    The following illustrates the search results when CLASS is before ROUTECDE and when CLASS is after ROUTECDE.

    Table 3. Search results when specifying class before ROUTECDE
    WS Criteria Order of Selection Output groups scanned Element selected
    WS=(Q,R)
    Q=ABC
    R=(Local,R1,R2)
    JOE1
    JOE2
    JOE3
    JOE4
    JOE6
    JOE5
    JOE7
    1
    1
    1
    3
    2
    2
    2
    1
    1
    1
    1
    1
    2
    2
    WS=(R,Q)
    Q=ABC
    R=(Local,R1,R2)
    JOE1
    JOE3
    JOE5
    JOE7
    JOE2
    JOE4
    JOE6
    1
    2
    5
    5
    4
    3
    2
    1
    2
    5
    5
    1
    1
    1
  • Give careful consideration to PRIORITY (P) in the work selection list. If CLASS (Q) is before the slash in the list, then placing PRIORITY after CLASS has no effect and adds unnecessary overhead to JES2 because the class queues are already in priority order.

    Placing PRIORITY (P) before CLASS (Q), and before the slash, causes JES2 to look for the highest priority piece of output in the system. This results in long searches while JES2 examines every piece of output looking for the highest priority work.

    The following illustrates the search results when specifying PRIORITY and when PRIORITY is not specified.

    Table 4. Search results when specifying PRIORITY
    WS Criteria Order of Selection Output groups scanned Elements selected
    WS=(Q,R)
    Q=ABC
    R=(R2,Local)
    JOE1
    JOE4
    JOE6
    JOE3
    JOE5
    JOE7
    2
    3
    3
    3
    4
    3
    1
    3
    3
    2
    3
    3
    WS=(P,Q,R)
    Q=ABC
    R=(R2,Local)
    JOE1
    JOE3
    JOE4
    JOE5
    JOE6
    JOE7
    8
    7
    6
    5
    4
    3
    1
    2
    2
    4
    2
    3
  • If you include JOBname in the WS list, it causes JES2 to gather all output for a job and attempt to process that output consecutively. The JOBNAME= parameter for a particular device determines what job name JES2 selects when JES2 has processed all output that matches the current job name.
    • If JOBname= is specified before the slash in the WS= list:

      JES2 selects only those jobs that match the value specified on JOBNAME= for a specific device. When JOBNAME= is specified as a generic name, JES2 only processes jobs that match that pattern and attempts to process all output for that job name consecutively.

    • If JOBname= is specified after the slash in the WS= list:

      JES2 uses the value specified on JOBNAME= to select new job names for the specific device. If there are no job names that match the JOBNAME= specification, JES2 selects jobs as if JOBname were not listed in the WS= list. A device gathers and processes all output for a particular job before again examining the value specified on JOBNAME= for more jobs.

      If you require JES2 to group jobs based on job name but do not want JES2 to prefer a particular JOBNAME= pattern, specify JOBNAME=* on the device statement and code JOBname after the slash in the WS= list.

      Note:
      1. Use a $T devname,JOBNAME=jobname command to stop processing jobs of the current JOBNAME= specification and begin searching for jobs of the new name.
      2. Specifying JOBNAME in the WS list causes JES2 to examine all output while gathering output for a job and finding job name matches. This causes performance degradation.
    • If your installation has many active remote devices, minimize the number of queue elements searched by spreading the output for different remotes over multiple classes.

    Many RJE devices that share the same class queue unnecessarily search a large queue of output destined for other remotes.

Carefully consider all work selection settings. Specifying the WS list incorrectly or inappropriately causes exhaustive searches of the JES2 output queues and excessive processing.