Understanding and Customizing SAS Output: The Basics |
Specifying SAS System Options |
You can enhance the appearance of your output by specifying SAS system options on 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:
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.
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 that the SAS session was started.
options linesize=64 nocenter number date; libname admin '/u/lirezn/saslearnV8'; 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;
The following output shows the results:
Effect of System Options on SAS Output
SAT Scores: 525 and Above 1 10:59 Wednesday, October 11, 2000 Obs Test Gender Year SATscore 1 Verbal m 1972 531 2 Verbal f 1972 529 3 Math m 1972 527 4 Math m 1973 525 5 Math m 1995 525 6 Math m 1996 527 7 Math m 1997 530 8 Math m 1998 531
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.