SAS 9.1 Language Reference Concepts

Example of Traditional Listing Output

Many SAS procedures process or analyze data and can produce output as one result. You can also generate a listing by the DATA step, using a combination of the FILE and PUT statements.

See the procedure descriptions in Base SAS Procedures Guide for examples of output from SAS procedures. For a discussion and examples of DATA step output, see the FILE and PUT statements in SAS Language Reference: Dictionary .

This example produces a listing that is generated by the PUT and FILE statements in a DATA step. The input file is the SAS data set GRAIN_PRODUCERS.

options pagesize=60 linesize=64 nodate pageno=1; title 'Leading Grain Producers'; title2 'for 1996'; data _null_; set grain_producers; file print header=newpage; if year=1996; format country $cntry.; label type='Grain'; put country @25 type @50 kilotons; return; newpage: put 'Country' @25 'Grain' @50 'Kilotons'; put 60*'='; return; run; Leading Grain Producers 1 for 1996 Country Grain Kilotons ============================================================ Brazil Wheat 3302 Brazil Rice 10035 Brazil Corn 31975 China Wheat 109000 China Rice 190100 China Corn 119350 India Wheat 62620 India Rice 120012 India Corn 8660 Indonesia Wheat . Indonesia Rice 51165 Indonesia Corn 8925 United States Wheat 62099 United States Rice 7771 United States Corn 236064

Making Output Descriptive

There are several ways to customize SAS procedure output and DATA step output. You can change the look of output by adding informative titles, footnotes, and labels, and by changing the way the information is formatted on the page. The following list describes some of the statements and SAS system options that you can use.

CENTER NOCENTER system option

DATE NODATE system option

FOOTNOTE statements

FORMCHAR=

FORMDLIM=

LABEL statement

LINESIZE= and PAGESIZE= system options

NUMBER NONUMBER and PAGENO= system options

TITLE statements

See SAS Language Reference: Dictionary for more information about how to use these and other SAS system options and statements.

Reformatting Values

Certain SAS statements, procedures, and options enable you to print values using specified formats. You can apply or change formats with the FORMAT and ATTRIB statements, or with the VAR window in a windowing environment.

The FORMAT procedure enables you to design your own formats and informats, giving you added flexibility in displaying values. See the FORMAT procedure in Base SAS Procedures Guide for more information.

Printing Missing Values

SAS represents ordinary missing numeric values in a SAS listing as a single period, and missing character values as a blank space. If you specified special missing values for numeric variables, SAS writes the letter or the underscore . For character variables, SAS writes a series of blanks equal to the length of the variable.

The MISSING= system option enables you to specify a character to print in place of the period for ordinary missing numeric values.

Категории