Previous Topic: Log Manager Statistics

Next Topic: Macros

Report Structure

The following example code for the ABENDSUM canned report is based on the provided macros and shows the structure of a CA Easytrieve program. Most of the comments in this example were removed for brevity.

Note: The line numbers shown on some lines match the explanation section, but are not part of the program.

1  MACRO 0 EACH 'DAY'          +
           SHIFT '00:00 24:00' +
           FROM 'ALL'          +
           TO   'ALL'          +
           RECTYPE 255
2  %SYSVCDEF RECTYPE &RECTYPE  +
            EACH '&EACH'       +
            FROM '&FROM'       +
            TO   '&TO'         +
            SHIFT '&SHIFT'     +
            SEGMENT EXPCRABS
3  JOB INPUT SMFIN START SET-PARMS
4  PERFORM SELECT-REC. 
    IF SELECTED = 'T'
5     %SYSVFOR EXPCRABS ABENDS
      END-IF
6  %SYSVPROC. *Common subroutines

7  REPORT ABENDS PRINTER REPORTS SUMMARY SUMCTL DTLCOPYALL +
   SPACE 2 NOADJUST LONGDATE
   SEQUENCE TITLE-TSTAMP MNS_TRAN ABS_ABNDPGM ABS_ABNDCODE
   CONTROL FINAL NOPRINT TITLE-TSTAMP NEWPAGE NOPRINT MNS TRAN NOPRINT +
           ABS_ABNDPGM NOPRINT ABS_ABNDCODE
   TITLE 1 '             Sysview CICS Program  ABEND Summary'
   TITLE 2 'From:          ' LOW-STAMP    ' Each:     &EACH'
   TITLE 3 'To:            ' HIGH-STAMP   ' Shift:    &SHIFT'
   TITLE 4 'Interval Start:' TITLE-TSTAMP
   HEADING MNS_TRAN     ('TRAN'    '----')
   HEADING ABS_ABNDPGM  ('PROGRAM' '--------')
   HEADING ABS_ABNDCODE ('CICS'    'ABEND CODE' '--------')
   HEADING ABS_ABNDOCOD ('SYSTEM'  'ABEND CODE' '--------')
   HEADING TALLY        ('COUNT'   '------')
   LINE MNS_TRAN ABS_ABNDPGM ABS_ABNDCODE TALLY

The following explanations correspond to the line numbers in the preceding example:

  1. This section of the code defines the ABENDSUM program as a macro so that parameters can be specified easily when the program is run. This example has no positional parameters, and five keyword parameters (EACH, SHIFT, FROM, TO, and RECTYPE), each with a default value.

    The following examples show how to invoke this macro:

    %ABENDSUM
    %ABENDSUM  EACH HOUR
    
  2. This section invokes the SYSVCDEF macro. This macro:

    The SEGMENT parameter identifies the primary data segment to use for the report.

  3. This line begins the extraction section. The JOB statement defines and initiates processing activities as follows:
    INPUT SMFIN

    The INPUT parameter identifies the SMFIN input file.

    START SET-PARMS

    The START parameter runs the SET-PARMS subroutine, which initializes the selection criteria.

  4. This PERFORM statement runs the SELECT-REC subroutine for each record in the input file. This subroutine performs common selection and filtering. If you want to process the record, set the variable SELECTED to T (true); otherwise it is set to F (false).
  5. This line issues a PRINT statement for each EXPCRABS segment in the current record.
  6. This line includes common subroutine definitions.
  7. This section defines the output report.