Writing Output without Creating a Data Set
In many cases, when you use a DATA step to write a report,
you do not need to create an additional data set. When you use the
DATA _NULL_ statement, SAS processes the DATA step without writing
observations to a data set. Using the DATA _NULL_ statement can increase
program efficiency considerably.
The following is an
example of a DATA _NULL_ statement:
data _null_;
The following program
uses a PUT statement to write women’s Olympic medalist information
to the SAS log. Because the program uses a DATA _NULL_ statement,
SAS does not create a data set.
data _null_
; length medalist $ 19; input year 1-4 medalist $ 6-24 medal $ 26-31 country $ 33-35 result 37-41;put medalist country medal result year ...
Get Step-by-Step Programming with Base SAS 9.4 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.