Previous Topic: 5.2.1.3 BATJOB Usage Considerations

Next Topic: 5.2.2 Batch User Job Suspend File (BAT_JS)

5.2.1.4 BATJOB Retrieval Examples


This section presents typical BATJOB retrieval examples.

1.  Print all executions of job 'PXY004' that were processed
    in the data for yesterday's update.

    DATA;
    SET &pBATX..BATJOB01;
    IF JOB='PXY004';
    PROC PRINT; VAR SYSID JOB RDRTS STARTTS ENDTS;

2.  Print all executions of job 'PXY004' for yesterday.

    DATA;
    SET &pBATX..BATJOB01
        &pBATX..BAT_JS01;
    IF JOBSUSPN LE 1;
    IF ENDTS=TODAY()-1 OR STARTTS=TODAY()-1;
    IF JOB='PXY004';
    PROC PRINT; VAR SYSID JOB RDRTS STARTTS ENDTS;

3.  Print all jobs executed by department PAY where the
    department is the second account code number.

    DATA;
    SET &pBATX..BATJOB01;
    IF ACCTNO2='PAY';
    PROC PRINT; VAR SYSID JOB RDRTS STARTTS ENDTS;

4.  Print all jobs that abended with a system 122 or 222
    operator cancel abend.

    DATA;
    SET &pBATX..BATJOB01;
    IF JOBSYSAB=1;
    IF TERMCODE=' 222' OR TERMCODE=' 122';
    PROC PRINT;
         VAR SYSID JOB RDRTS STARTTS ENDTS TERMCODE;

5.  Print all jobs that flushed with a JCL error.

    DATA;
    SET &pBATX..BATJOB01;
    IF JOBJCLER=1;
    PROC PRINT;
         VAR SYSID JOB RDRTS;

6.  Print all jobs that missed their turnaround target.

    DATA;
    SET &pBATX..BATJOB01;
    IF JOBSRVMS=1;
    PROC PRINT;
        VAR SYSID JOB RDRTS JOBTURTM JOBTARTM JOBGROUP;

7.  Print total resource consumption in service units for all
    batch jobs activity processed for accounts ACCTNO1 'PR',
    'PX', and 'XC' over the last two months:

    %LET BY = ACCTNO1 ;
    %LET BREAK = ACCTNO1 ;
    DATA FILE1;
    SET &pBATM..BATJOB01
        &pBATM..BATJOB02;
    IF ACCTNO1='PR' OR ACCTNO1='PX' OR ACCTNO1='XC';
    PROC SORT DATA=FILE1; BY &BY:
    DATA FILE1;
    SET FILE1;
    %JOBSUM;
    RUN;
    PROC PRINT; VAR SYSID ACCTNO1 JOBSERVU JOBCOUNT;

8.  Reporting Batch Job Service

Analyzing batch job service and performance is simplified
considerably through the use of batch job groups as
implemented in the CA MICS data base. The job group is a
method to classify batch jobs in terms of their attributes
that pertain to service requested and received.  It is
defined by the installation and may be derived from data such
as class, priority, jobname, etc.  The job group is a
three-character numeric field that has a value from 1-149 for
standard job groups, 150-179 for deadline job groups, 180-197
for open user definitions, and 198-199 for CA MICS use.

For a complete discussion of job service classification and
job turnaround time as implemented by CA MICS, refer to
Sections 7.3.2 through 7.3.3 of this guide.

JOBGRPRC is a classification variable that depends on
delivered turnaround time for this job.  The interpretation
and use of JOBGRPRC are best explained by an example.
Suppose a PARMS(JOBGROUP) member contains the following text:

 ....
GROUP  1    10 1 '10 MIN BATCH TURNAROUND'
GROUP  3    30 1 '30 MIN BATCH TURNAROUND'
GROUP  5    60 1 '1 HOUR BATCH TURNAROUND'
GROUP  7   240 1 '4 HOUR BATCH TURNAROUND'
GROUP  8   240 1 '4 HOUR BATCH TURNAROUND'
GROUP  9  1440 1 ' 1 DAY BATCH TURNAROUND'
GROUP 11 10080 1 ' 7 DAY BATCH TURNAROUND'
 ....

Jobs assigned to each GROUP are expected to turn around in
less than that GROUP's limit.  The same table can be entered
in the other direction:  jobs with turnaround times between a
GROUP's upper and lower limits are said to have received that
GROUP's service.

For example, suppose that the installation has decided that
turnaround times depend only on execution class, with class H
jobs required to finish within 10 minutes, class A jobs
within one hour, and class B and C jobs within four hours.
From the above table, all class H jobs are assigned to GROUP
1, class A to GROUP 5, and classes B and C to GROUPs 7 and 8,
respectively.  The CA MICS observation for a class H job has
JOBGROUP=1, and so forth.

When the jobs run, they may or may not turn around within the
expected limits.  From the above table, a job completing
within 10 minutes has received GROUP 1 service and shows
JOBGRPRC=1.  A job completing in between 10 and 30 minutes
has received GROUP 3 service, etc.  Notice that jobs
completing within one to four hours show JOBGRPRC=7 only,
although both GROUP 7 and 8 share that range.

One useful technique for gauging batch work performance
against installation requirements is to use SAS PROC FREQ to
compare requested with delivered service.  This SAS code:

DATA;
* survey yesterday's workload;
SET DETAIL.BATJOB01;
* exclude deadline and special work;
IF JOBGROUP <= 149;
* go easy on storage demand;
KEEP JOBGROUP JOBGRPRC;

PROC FREQ;
* suppress the percentage calculations;
TABLE JOBGROUP * JOBGRPRC / NOROW NOCOL NOPERCENT;

produces a table with requested service running downward and
delivered service running across.  Each job gives one tally
in the cell for its requested and delivered service.  Jobs
meeting service levels are along the main diagonal (JOBGROUP
=1 and JOBGRPRC=1, JOBGROUP=2 and JOBGRPRC=2, etc.).  Jobs
exceeding service levels are above and to the left of the
main diagonal (JOBGROUP=2 but JOBGRPRC=1, JOBGROUP=3 but
JOBGRPRC=1 or 2, etc.).  Jobs missing service levels are
below and to the right of the main diagonal (JOBGROUP=1 but
JOBGRPRC=2 or higher, etc.).

JOBTURTM contains the total amount of time required for this
job's turnaround.  JOBTURTM is set to missing for DEADLINE,
OPEN, and CA MICS-reserved job groups.  For STANDARD job
groups, the definition of turnaround time may be unique to
the installation.  CA MICS supplies a default option whereby
JOBTURTM is computed as the sum of any or all of the
following:

    JOBCVTTM - Converter Time
    JOBINQTM - Input Queue Time
    JOBENQTM - Step Enqueue Time
    JOBALCTM - Step Allocation Time
    JOBEXCTM - Execution Time

The JOBGROUP member must be updated with the installation's
turnaround-time specification.  JOBTURTM may also be computed
by SAS code supplied by the installation, which supersedes
the table-driven CA MICS calculation from the aforementioned
times.

The following SAS code provides average turnaround times for
standard jobs.  You may wish to delete some of the filters or
add new ones, depending upon installation-specific concerns.

DATA;
* Look at jobs completed yesterday;
SET DETAIL.BATJOB01;
* Go easy on storage;
KEEP JOBGROUP JOBTURTM;
* Look at standard jobgroups only;
IF JOBTURTM NE .;
* Skip non-execution jobs;
IF JOBJCLER  EQ 0
AND JOBFLUSH EQ 0
AND JOBCOPY  EQ '0'
AND JOBSCAN  EQ '0';
* Skip jobs which were held;
IF JOBHOLD EQ '0';
* Collect jobgroups together;
PROC SORT; BY JOBGROUP;
* Obtain totals;
PROC MEANS NOPRINT; BY JOBGROUP; VAR JOBTURTM;
OUTPUT SUM = JOBTURTM N = JOBCOUNT;
* Build simple report;
DATA _NULL_;
SET;
AVETURTM = JOBTURTM / JOBCOUNT;
FILE PRINT;
PUT @10 JOBGROUP= 3.
    @30 JOBCOUNT= 4.
    @50 AVETURTM= COMMA5.  ;