Tags

, , , , , , , , ,

EASYTRIEVE – Special-name Report Procedures

Report procedures are invoked at specific points of the report processing activity. By analyzing these points, you can determine the specific use of the various procedures. The exhibit that follows illustrates the procedures listed below:

REPORT-INPUTA REPORT-INPUT procedure selects and/or modifies report input data.
This procedure is performed for each PRINT statement (report input). In order to cause the data to continue into report processing, you must execute a SELECT statement for the associated input data. In other words, input that does not get SELECTed is bypassed for continued processing.

The below example illustrates use of the REPORT-INPUT procedure in final report input selection. The first 10 report inputs for each code are the only ones selected for ultimate report input:

DEFINE COUNT S 2 P 0

DEFINE HOLD-CODE S CODE


REPORT-INPUT. PROC

IF CODE NE HOLD-CODE

HOLD-CODE = CODE

COUNT = 0

END-IF

IF COUNT LT 10

COUNT = COUNT + 1

SELECT

END-IF

END-PROC

BEFORE-LINE and AFTER-LINE

A BEFORE-LINE procedure is invoked immediately before, and an AFTER-LINE procedure immediately following, the printing of each detail line. These procedures are typically used for special annotation associated with these detail lines.

DEFINE COUNT S 2 P 0


AFTER-LINE. PROC (could be BEFORE-LINE)

IF COUNT EQ 4

DISPLAY ‘ ‘

COUNT = 0

ELSE

COUNT = COUNT + 1

END-IF

END-PROC

BEFORE-BREAK

This procedure can be used in control reports to modify totals before they are printed. A typical application is to calculate averages and/or percentages for the fields totaled.

For example – Please check my other post

EASYTRIEVE – Sample Program – Display Totals and Summary

AFTER-BREAK

An AFTER-BREAK procedure can be used to produce a special annotation on control reports.
You can use the value of LEVEL (a system-defined field) to determine which control break is being processed.

REPORT …

CONTROL CTLN CTL1


AFTER-BREAK. PROC

IF LEVEL EQ 1

DISPLAY ‘TOTALS FOR DEPARTMENT’ CTL1

END-IF

END-PROC

ENDPAGE

You can use an ENDPAGE procedure to produce page footing information. It is invoked whenever end-of-page is detected. It is typically used to produce page totals or other annotations.

ENDPAGE. PROC

DISPLAY PAGE-AMT ‘ IS THE PAGE TOTAL’

DISPLAY SKIP 2 ‘CONFIDENTIAL – FOR EYES ONLY’

END-PROC

TERMINATION

A TERMINATION procedure is invoked at the end of the report. You can use this procedure to print report footing information, including control totals and distribution information. The next exhibit is an example of report footing:


TERMINATION. PROC

DISPLAY NEWPAGE

DISPLAY GRAND-TOTAL ‘ IS THE CONTROL TOTAL’

DISPLAY SKIP 5 ‘ROUTE TO: …’


END-PROC

 

 

You may also like to look at:

Important SQL CODES and ABEND CODES
SORT JOIN – TO JOIN TWO FILES BASED ON A KEY
KNOW YOUR MAINFRAME
REXX – INITIAL SETUP
EASYTRIEVE – A023 ABEND
EASYTRIEVE – SORT and FILE COMPARISION
EASYTRIEVE – Special-name Report Procedures
EASYTRIEVE – REPORT STAEMENT
EASYTRIEVE – Sample Program – Table And Search
EASYTRIEVE – Sample Program – Display Totals and Summary
EASYTRIEVE – Sample Program – Display Employee Data
CA-Easytrieve/Plus – Basics
REXX TOOL # 02 – FSAVE – Save member opened in VIEW mode
REXX TOOL # 01 – O – Open Any Mainframe Element from any ISPF Screen
REXX – INDEX, POS, SUBSTR, COMPARE
REXX – READ THE DSN PROVIDED AS DD IN JCL
REXX – SEND MULTIPLE ARGUMENTS THROUGH JCL
REXX – HOW TO COMPILE YOUR REXX EXEC
REXX – CHANGE UPPER TO LOWER CASE
REXX – GET LAST 4 DAYS FROM GIVEN DATE
REXX – PANEL Definition
REXX – READ, CREATE AND WRITE DATA TO A DATASET
REXX TOOL TO SUBSTITUTE SYMBOLICS IN A PROC

 


Advertisements