Suppress Printing Statement
The SUPPRESS PRINTING statement enables you to prevent a particular report group from being output on a particular occasion.
Suppress Printing Statement: Coding Rules
-
The SUPPRESS statement may be coded only in a USE BEFORE REPORTING directive Declarative SECTION.
-
The form MOVE 1 TO PRINT-SWITCH is an alternative IBM extension that means the same as SUPPRESS PRINTING. You may also write MOVE 0 TO PRINT-SWITCH to undo the effect of a MOVE 1 TO PRINT-SWITCH or SUPPRESS PRINTING, and generally treat PRINT-SWITCH as a numeric location, implicitly defined in your program.
Suppress Printing Statement: Operation
-
The statement SUPPRESS PRINTING or MOVE 1 TO PRINT-SWITCH prevents the group specified in the USE BEFORE REPORTING from producing any output on this occasion. In other words, no data is set up in any of the lines of the group and none of the lines is produced. LINE-COUNTER is also left unaltered, so suppressing a body group will prevent a page advance. This statement suppresses only the storing of report data and the output of the report lines. It does not prevent other processing, such as the accumulation and clearing of totals and the setting and testing of CONTROL fields. In this respect, it is different from a PRESENT WHEN clause at the 01-level which does prevent all other processing.
-
For example, you may use SUPPRESS PRINTING to "restart" your report after a breakdown. Simply write a USE BEFORE REPORTING section for every group and SUPPRESS each group until your program clears a flag. Your report will now be in the same internal state as when output really took place.
-
Each execution of a SUPPRESS PRINTING or MOVE 1 TO PRINT-SWITCH will prevent output only on that single occasion. Report writer will reset PRINT-SWITCH to zero after each excursion into your USE BEFORE REPORTING section.
-
In USE BEFORE REPORTING there are further examples of SUPPRESS PRINTING.
Compatibility
Apart from the ANS-85 GLOBAL phrase, OS/VS and DOS/VS COBOL, and new Report Writer agree in their formats for this statement, but new Report Writer allows a USE BEFORE REPORTING section to be coded for a DETAIL group.