Previous Topic: OutputNext Topic: Sample Input Program for the RPTLL2 Report


Sample Input Program for the RPTLL Report

The following is a brief explanation of the program for this report.

NOTE *‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑*
NOTE * THIS EARL PROGRAM IS BASED ON THE CA ACF2 LL REPORT*
NOTE *‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑*
 
 OPTION PRINTER=80
 OPTION LIST OFF
 
NOTE *‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑*
NOTE * CHANGE LOG:                                            *
NOTE *                                                        *
NOTE * RELEASE: 6.3                                           *
NOTE *                                                        *
NOTE * TA3985D  07/14/98  Z0012                               * TA3985D
NOTE *          INCREASED RECORD LENGTH OF ACFSMFR FILE       * TA3985D
NOTE *          FOR LONGER OMVS SMF RECORDS.                  * TA3985D
NOTE *                                                        *
NOTE * RELEASE: 6.5                                           *
NOTE *                                                        *
NOTE * TA6015G  03/13/02  Z0037                               * TA6015G
NOTE *          REBRANDING CHANGES.                           * TA6015G
NOTE *                                                        *
NOTE * END OF LOG.                                            *
NOTE *                                                        *
NOTE *‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑*
 
NOTE *‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑*
NOTE * TO USE SRAM SORT REMOVE NOTE BELOW                *
NOTE *‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑*
NOTE OPTION SORT=SRAM
 
 ACFFLT: FILE ACFSMFR RECORD=23756                            ! TA3985D
 
COPY HDRECORD
COPY LRECORD1
COPY LRECORD2
 
DEF WHOLEHDR   8‑232 X
DEF RC=ACFSMFR 1‑4 B

GET ACFFLT
GOTO EOJ (RC=‑1)
 
REPORT 'LOGONID MODIFICATION LOG'
TITLE 'RUN DATE:' DATEOFREPORT 'RUN TIME:' TIMEOFREPORT
 
NOTE  SELECT ONLY TYPE 'L' RECORDS. PRINT SUMMARY LINE FOR EACH RECORD
NOTE  PRINT DETAIL LINE IF IT EXISTS.
 
 SELECT 'A' RECTYPE='L' AND SEQUENCE = '1' AND FUNCTION NOT = 'UPDATE'
 SELECT 'B' RECTYPE='L' AND SEQUENCE = '2' AND FUNCTION NOT = 'UPDATE'
 
NOTE *‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑*
NOTE * IF UPDATE RECORDS ARE TO BE REPORTED REMOVE THE 'NOTE' BELOW*
NOTE *‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑*
NOTE SELECT 'C' RECTYPE = 'L'
 
 CONTROL WHOLEHDR SEQUENCE
 IFTAG A;PRINT DATE TIME LKEY JOBNAME LOGONID FUNCTION CPU MODEL
 
NOTE *‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑*
NOTE * IF UPDATE RECORDS ARE TO BE REPORTED REMOVE THE 'NOTE' BELOW*
NOTE *‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑*
 
NOTE IFTAG C;PRINT DATE TIME LKEY JOBNAME LOGONID FUNCTION CPU MODEL
 
 IFTAG B;PRINT @12 CHANGENAME BEFORE_SHORT AFTER_SHORT
 
 END
Highlights

The following letters correspond directly to the letters and braces on the previous page. Each brace highlights a significant part of the customized CA Earl report.

A OPTIONS. In this example, this information is sorted with the user sort program. To sort the information with the CA‑SRAM method, remove the word NOTE from the line containing the statement OPTION SORT=SRAM. To sort by another method, use this option to specify that method.

Note: If you are a VM site, SRAM SORT is the default.

B INPUT FILE. Specifies which file is used as input. You must include this statement exactly as it is shown in the sample.

C FIELD DEFS. This report uses the copybooks HDRECORD, LRECORD1, and LRECORD2.

In addition to the COPY statements that bring in descriptions of the records processed in this report, we also defined an item called WHOLEHDR to be columns 8 through 232 of each record. This item is used later, in the sort logic, to pair off any records that together report a single modification event. That is, if a logonid modification was made that results in two flat file records being written, we want to pair off those records together. Since for each of those pairs, columns 8 through 232 is identical, we can use that portion of the record as the primary sort field, thus assuring that those pairs occur together in the sorted flat file.

D READ FILE. The file the report reads for processing.

E SETUP. Defines a report header and one additional header (TITLE) line for pages of the report. Assigns the current record to a group based on the contents of certain record fields. For example, if the record has the value L in the field RECTYPE and the value 1 in the SEQUENCE field and the FUNCTION field does not have UPDATE as its value, then the record is assigned to group A. Records are assigned into group B on the same criteria except for the SEQUENCE value. Group C gets all the records with RECTYPE L. Notice, as is the case here, that it is possible for a record to be assigned to more than one group. We can use these groups later on for selective printing of detail information.

F PRINT LOGIC. Sorts the records so that for each recorded event, the summary record occurs first, followed by the detail record if there is one. WHOLEHDR was defined, basically, as the portion of a record excluding the SEQUENCE field and some other items at the front of the record. Sorting first on WHOLEHDR results in pairs of records that have identical header information (including time and date) occurring together. Each such pair consists of the summary record and the detail record (if there is one). Since SEQUENCE is the second sort item, each such pair is then arranged with the summary record (SEQUENCE=1) occurring first and the detail record (SEQUENCE=2) occurring next.

If the current record is in group A, then it was a summary record. We print identifying information from this record, including date, time, record key, changer's logonid, and the change type (FUNCTION).

If the NOTE was removed to activate the SELECT "C" statement and if the current record is in group C, then it was an UPDATE type record. These have only summary records written in the flat file. If the NOTE is removed from the IFTAG C statement, then the report prints the same information for this record as it printed for the group A record.