Modifying Output with the PUT Statement

The example "Controlling the Layout of the Output" earlier in this chapter placed blank lines between BY groups of a report. Let's refine that example so that when the DATA step processes the last observation in a BY group, it lists informative text and the total number of events for that BY group, rather than just writing a blank line.

The program uses standard DATA step logic to retain the total variable ITOT, which will contain the number of events in a BY group. When processing the first observation in a BY group, the DATA step initializes its value to 1. Its value is incremented by 1 in the ELSE DO group each time the DATA step processes a subsequent observation in the BY group. The last PUT statement ...

Get Output Delivery System: The Basics and Beyond now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.