Tags
after break, after line, before break, before line, easytrieve, endpage, mainframe, report input, special name report procedures, termination
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-INPUT – A 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
——————————————————————————————————–
In United States, If you would like to Earn Free Stocks, Credit card Points and Bank account Bonuses, Please visit My Finance Blog
——————————————————————————————————–
You may also like to look at:
Working on Mainframes – Is Change to a different technology necessary |