Previous Topic: User-Defined Report Examples

Next Topic: Example 2: A More Complex Report


Example 1: Creating a User-Defined Report

  1. First, there are some required control statements in every user-defined report. They are:
    SELECT

    This statement defines the input and output to CA JARS.

    HEADER

    This statement places a report header on the top of each page of the report.

    SORT

    This statement defines the sort fields and summary options.

    DISPLAY

    This statement defines the elements on the report. That is, column by column, it describes the contents of the print line to CA JARS.

    Before proceeding, please read the individual explanations of these control statements in the "Control Statements and Tables" chapter of this guide.

  2. Each report is identified by its set code. That is, all control statements for a report have the first position coded as the same character. This sample report uses a 1 for the set code.
  3. The report must be sorted in some order to be useful, so we need to pick a field to sort on. To determine the beginning position of the field to be sorted, the format of the field being sorted, and the length of the field to be sorted, see the Basic Accounting Table in the "Control Statements and Tables" chapter.
  4. The output report columns are determined by the DISPLAY statement.

    Note that these two tables:

    are the keys to using CA JARS. Data elements are identified for sorting and grouping using the Basic Accounting Table. The Output Data Elements Table is always used to tell the report writer which fields to print. Please review each of these tables.

This exercise creates a detail-level report, showing JOB NUMBER and CPU TIME by JOB NAME.

A SELECT statement is required to tell CA JARS what the input will be and which reports to create.

position   1         2         3         4         5             8
 1.........0.........0.........0.........0.........0....      ...0
  SELECT     1                                      1
             ▲                                      ▲
             │                                      │
             └──── to indicate SMF data is input    │
                                                    │
                                                    │
       indicates the set code of all the            │
       control statements for this report ──────────┘

A HEADER statement gives the report a heading, and is required.

position   1         2                  8
 1.........0.........0...            ...0
 1HEADER      CPU TIME BY JOB NAME

A SORT statement orders the report.

                ┌─────── a summary line will be generated every time
                │        JOB NAME changes in the control field
position  1     ▼       2         5            8
 1........0.........0...    ..0...      ...0
 1SORT    01608 2             1
          ▲                   ▲
          │                   └─ Print JOB records
          │
          └──────sort on JOB NAME from the Basic Accounting Table;
                  it begins in position 16 of the record and is 8
                  positions long.

A DISPLAY statement indicates what information to display on the report.

               ┌──┬─┬───────────────────────────────────┐
               │  │ ▼                                   │
position   1   ▼  ▼ 2         3                   8     │
 1.........0........0.........0...             ...0     │
 1DISPLAY    004214266                                  │
             ▲  ▲  ▲                                    │
             │  │  │         output data element numbers (DE ID) from
             │  │  │         the Sequenced Output Data Element Table:
             │  │  │         JOB NAME (DE ID 04), JOB NUMBER
             │  │  │         (DE ID 14), and CPU TIME (DE ID 66)
             │  │  │
             └──┴──┘ # of spaces to be printed before the displayed
                     element (that is, 0 spaces before JOB NAME,
                     2 spaces before JOB NUMBER, and 2 spaces before
                     CPU TIME

So our control statements are:

position   1         2         3         4         5             8
 1.........0.........0.........0.........0.........0....      ...0
  SELECT      1                                     1
 1HEADER      CPU TIME BY JOB NAME
 1SORT     01608 2                                 1
 1DISPLAY    004214266

The JCL required to produce this report is provided in the "Operating Instructions" chapter. Be sure to update any installation-dependent parameters to your data center standard values.

The output report for Example 1 is:

CPU TIME BY JOB NAME BEGIN DATE - 02/05/98 RUN DATE - 02/27/98 END DATE - 02/05/98 PAGE 1 JOB JOB CPU NAME NBR TIME APPDA52 8645 00:01:47 APPDA52 9072 00:00:06 APPDA52 9513 00:01:49 3 00:03:42 ASMSCH 6262 00:00:06 ASMSCH 7564 00:00:06 ASMSCH 7595 00:00:05 ASMSCH 7608 00:00:05 ASMSCH 7852 00:00:05 ASMSCH 7855 00:00:06 ASMSCH 7857 00:00:05 ASMSCH 7918 00:00:05 ASMSCH 7919 00:00:06 ASMSCH 7923 00:00:05 ASMSCH 8170 00:00:06 ASMSCH 8825 00:00:05 ASMSCH 8863 00:00:05 13 00:01:10 ASMSCHC 7574 00:00:05 ASMSCHC 7602 00:00:05 ASMSCHC 7858 00:00:05 ASMSCHC 7859 00:00:05 ASMSCHC 7926 00:00:05 5 00:00:27 ASMS627 6271 00:00:05 ASMS627 6296 00:00:05 ASMS627 7975 00:00:05 ASMS627 8292 00:00:05 ASMS627 8906 00:00:05 ASMS627 8952 00:00:05 ASMS627 8966 00:00:05 ASMS627 9038 00:00:05 8 00:00:40 . . . ZAP51 6529 00:00:00 ZAP51 7254 00:00:01 ZAP51 7282 00:00:01 3 00:00:03 686 03:23:04

The calculated length of the print line is less than 132; the header is centered as much as possible over the print lines on each page.

There is a summary line for each change in job name (that is, the SORT field for this report), and a grand total line at the end of the report.

The output data element, JOB NUMBER (DE ID 14), when displayed on a summary line, becomes NUMBER OF JOBS.