Code these Report Writer structures in the Program Painter for report programs.
IO FD |
Name the input and output files. |
RED |
Add a Report Section to your program. |
CODE |
Specify a 2-character literal that identifies each print line with a specific report. |
CONTROL |
Identify data items that cause control breaks. |
WRITE ROUTINE |
Override a standard COBOL WRITE statement and execute your own routine. |
PAGE LIMIT |
Define the report format, such as the number of lines per page and where report lines appear on the page. |
MOCK |
Identify the report mock-up. |
01 TYPE |
Describe function, format, and characteristics of each report line. |
MOCKUP LINES |
Map the report mock-up lines to the lines on the printed report. |
OVERPRINT |
Highlight or underscore the lines identified in the MOCKUP LINES clause. |
SOURCE |
Map the report mock-up fields to the output fields on the printed report. |
VALUE |
Designate a literal value to print for the field each time the line prints. |
REFERENCE |
Identify a non-printing data field for summing in a control break. |
SUM |
Establish a sum accumulator for a corresponding SOURCE or REFERENCE data field, and print the total in a control break. |
INITIATE |
Open report files and initialize page, line, and sum counters and accumulators. |
GENERATE |
Generate and print all the report lines. |
USE BEFORE REPORTING |
Specify additional processing for a report group prior to printing. |
TERMINATE |
End report processing and close all files. |
The sequence in which mock-up fields are matched with the data item descriptions is the same as a page of text is read–from left to right across each line of the mock-up starting with the top line and continuing to the bottom. AMB matches the report mock-up fields to the data item description entries in your program according to the following rules:
1979 WXYZ EXTRA WIZARD
Code Report Writer structures in the Program Painter, associating the structures with keywords, as shown in this sample skeletal Report Writer program:
IO Input/Output statements . FD Input FD clause 01 Input record description FD Output FD clause 01 Output record description RED reportfilename CODE clause CONTROL clause WRITE ROUTINE clause PAGE LIMIT nn LINE FIRST DETAIL linenumber LAST DETAIL linenumber FOOTING linenumber. MOCK mockupreportname 01 TYPE IS REPORT HEADING /*for report header MOCKUP LINES clause OVERPRINT clause SOURCE clause|VALUE clause 01 TYPE PAGE HEADING /*for page header MOCKUP LINES clause SOURCE clause|VALUE clause 01 TYPE CONTROL HEADING /*for control header MOCKUP LINES clause SOURCE clause or VALUE clause 01 TYPE DETAIL /*for detail lines MOCKUP LINES clause SOURCE clause|VALUE clause REFERENCE clause 01 TYPE CONTROL FOOTING /*for control break MOCKUP clause SOURCE clause|VALUE clause SUM clause NTRY . . . INITIATE statement . . GENERATE statement . . TERMINATE statement . . .