|
Duplex Printing
"Save Paper and all those trees!" I'm sure that most of us who print large reports would prefer they be printed double-sided, thus saving on paper and bulk. If you have several reporting entities on a report, however, and it's ultimately going to be burst for distribution, you need a way to insert blank pages on sort breaks, if the prior group used an odd number of pages.
One solution was to produce a report using HOLD FORMAT WP and then post-process the report, inserting blank pages where needed: however this is not optimal for large reports, and requires extensive coding.
FOCUS for Mainframe Release 7.3 introduced the NEWPAGE feature, which can greatly simplify this process. By specifying NEWPAGE on a particular subhead or subfoot, for example, you can start a new page either after the subhead or before the subfoot, thus separating it from the associated data, but not separating the data from the following subhead or the prior subfoot.
TABLE FILE CAR
PRINT RCOST DCOST SALES
COMPUTE EVENODD/I5 = IMOD(TABPAGENO,2,'I1'); NOPRINT
COMPUTE SKIP/A1 = IF EVENODD EQ 0 THEN 'N' ELSE 'Y';
BY COUNTRY NOPRINT
BY CAR
BY BODYTYPE
ON COUNTRY PAGE-BREAK REPAGE
ON COUNTRY SUBFOOT NEWPAGE
" END OF DATA FOR <COUNTRY "
WHEN SKIP EQ 'Y'
ON TABLE NOTOTAL
HEADING CENTER
"NEW PAGE EXAMPLE "
“PAGE <TABPAGENO "
"COUNTRY <COUNTRY"
END |
Now, consider whether you wish to see the HEADING and column headings on the new page you created. If you prefer a blank page, you must code your column-headings and HEADINGs as a SUBHEAD to appear at the top of every page, as illustrated below:
TABLE FILE CAR
PRINT RCOST AS '' IN 35 DCOST AS '' IN 47 SALES AS '' IN 57
COMPUTE EVENODD/I5 = IMOD(TABPAGENO,2,'I1'); NOPRINT
COMPUTE SKIP/A1 = IF EVENODD EQ 0 THEN 'N' ELSE 'Y'; NOPRINT
BY COUNTRY NOPRINT
BY CAR AS ''
BY BODYTYPE AS '' IN 19
ON COUNTRY PAGE-BREAK REPAGE
ON COUNTRY SUBFOOT NEWPAGE
" THIS PAGE LEFT BLANK "
WHEN SKIP EQ 'Y'
-* THE FOLLOWING GETS HEADINGS AND COLUMN HEADINGS FOR START OF
-* EACH COUNTRY
ON COUNTRY SUBHEAD
"NEW PAGE EXAMPLE "
"PAGE <TABPAGENO "
"COUNTRY <COUNTRY </1 "
"CAR <19 BODYTYPE <33 RETAIL_COST <45 DEALER_COST <59 SALES "
"--- <19 -------- <33 ----------- <45 ----------- <59 ----- "
-* IF THE RECORDS FOR A PARTICULAR COUNTRY SPAN MULTIPLE PAGES
ON BODYTYPE SUBHEAD
"NEW PAGE EXAMPLE "
"PAGE <TABPAGENO "
"COUNTRY <COUNTRY </1 "
"CAR <19 BODYTYPE <33 RETAIL_COST <45 DEALER_COST <59 SALES "
"--- <19 -------- <33 ----------- <45 ----------- <59 ----- "
WHEN TABPAGENO NE LAST TABPAGENO AND COUNTRY EQ LAST COUNTRY
ON TABLE NOTOTAL
END
|
Here are the results:
NEW PAGE EXAMPLE
PAGE 1
COUNTRY ENGLAND
CAR BODYTYPE RETAIL_COST DEALER_COST SALES
--- -------- ----------- ----------- -----
JAGUAR CONVERTIBLE 8,878 7,427 0
SEDAN 13,491 11,194 12,000
JENSEN SEDAN 17,850 14,940 0
TRIUMPH HARDTOP 5,100 4,292 0
THIS PAGE LEFT BLANK
NEW PAGE EXAMPLE
PAGE 1
COUNTRY FRANCE
CAR BODYTYPE RETAIL_COST DEALER_COST SALES
--- -------- ----------- ----------- -----
PEUGEOT SEDAN 5,610 4,631 0
|
|