O'Reilly logo

Step-by-Step Programming with Base SAS 9.4, Second Edition, 2nd Edition by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The following output displays the results:
Output 33.5 Titles, Labels, and Footnotes in SAS Output
Controlling Output Appearance of Listing Output
Specifying SAS System Options
You can enhance the appearance of your Listing output by specifying SAS system
options in the OPTIONS statement. The changes that result from specifying system
options remain in effect for the rest of the job, session, or SAS process, or until you issue
another OPTIONS statement to change the options.
You can specify SAS system options through the OPTIONS statement, through the
OPTIONS window, at SAS invocation, at the initiation of a SAS process, and in a
configuration file. Default option settings can vary among sites. To determine the
settings at your site, execute the OPTIONS procedure or browse the OPTIONS window.
The OPTIONS statement has the following form:
624 Chapter 33 Understanding and Customizing SAS Output: The Basics
OPTIONS option(s);
where option specifies one or more SAS options that you want to change.
Note: An OPTIONS statement can appear at any place in a SAS program, except within
data lines.
Numbering Pages
By default, SAS numbers pages of output starting with page 1. However, you can
suppress page numbers with the NONUMBER system option. To suppress page
numbers, specify the following OPTIONS statement:
options nonumber;
This option, like all SAS system options, remains in effect for the duration of your
session or until you change it. Change the option by specifying
options number;
You can use the PAGENO= system option to specify a beginning page number for the
next page of output that SAS writes. The PAGENO= option enables you to reset page
numbering in the middle of a SAS session. For example, the following OPTIONS
statement resets the next output page number to 5:
options pageno=5;
Centering Output
By default, SAS centers both the output and output titles. However, you can left-align
your output by specifying the following OPTIONS statement:
options nocenter;
The NOCENTER option remains in effect for the duration of your SAS session or until
you change it. Change the option by specifying
options center;
Specifying Page and Line Size
Procedure output is scaled automatically to fit the size of the page and line. The number
of lines per page and the number of characters per line of printed output are determined
by the settings of the PAGESIZE= and LINESIZE= system options. The default settings
vary from site to site and are further affected by the machine, operating environment,
and method of running SAS. For example, when SAS runs in interactive mode, the
PAGESIZE= option by default assumes the size of the device that you specify. You can
adjust both your page size and line size by resetting the PAGESIZE= and LINESIZE=
options.
For example, you can specify the following OPTIONS statement:
options pagesize=40 linesize=64;
The PAGESIZE= and LINESIZE= options remain in effect for the duration of your SAS
session or until you change them.
Controlling Output Appearance of Listing Output 625
Writing Date and Time Values
By default, SAS writes at the top of your output the beginning date and time of the SAS
session during which your job executed. This automatic record is especially useful when
you execute a program many times. However, you can use the NODATE system option
to specify that these values not appear. To do this, specify the following OPTIONS
statement:
options nodate;
The NODATE option remains in effect for the duration of your SAS session or until you
change it.
Choosing Options Selectively
Choose the system options that you need to meet your specifications. The following
program, which uses the conditional IF-THEN/ELSE statement to subset the data set,
includes a number of SAS options. The OPTIONS statement specifies a line size of 64,
left-aligns the output, numbers the output pages and supplies the date on which the SAS
session was started. Because HTML output is created by default, you should first close
the ODS HTML destination with the ODS HTML CLOSE statement. If you do not want
to create HTML output, closing the HTML destination saves system resources. The ODS
LISTING destination is closed by default. You must specify the ODS LISTING
statement to open the LISTING destination and create Listing output.
ods html close;
ods listing;
options linesize=64 nocenter number date;
libname admin 'SAS-data-library';
data high_scores;
set admin.sat_scores;
if SATscore < 525 then delete;
run;
proc print data=high_scores;
title 'SAT Scores: 525 and Above';
run;
ods listing close;
The following output displays the results:
626 Chapter 33 Understanding and Customizing SAS Output: The Basics

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required