Return to UOCC HomeComputing News Home
Header bar

SAS V. 8 is Here! Latest Release Adds More Options, New Output Delivery System

By Robin High
robinh@oregon.uoregon.edu

It's taken a long time to get here, but Version 8.0 of SAS has recently been installed on Oregon, Darkwing, and Gladstone, replacing the long-used Version 6.12. (Version 7 was considered a beta test for Version 8 on many systems, hence the leap to Version 8). The time needed to test and refine new features accounts for the relatively long delay in its release.

Version 6.12 will continue to be available on Darkwing until 12/31/2000 as a courtesy to those of you who may need time to test and modify programs and data files. You can invoke version 6.12 by typing sas6 at the % prompt.

Longtime SAS users will find most statements and procedures unchanged, and many programs written for 6.12 and earlier versions should still work with few or no modifications. However, as with any new version, many features have been added, including:

Version 8 Highlights

Details of some of Version 8's most notable changes are summarized below:

Documentation. The old "white" books (documentation for Version 6) took up most of a mid-sized bookcase, and individual manuals were heavy and laborious to use. SAS 8 documentation is online at http://sas.uoregon.edu/ (accessible from UO only), and you can also obtain it on a CD-ROM. Either source can be added to your "Favorites" in a web browser for fast and easy reference. A master index is available for quick lookup. If you prefer, you may also purchase printed "blue" manuals from the SAS Institute, or check them out at the Computing Center Documents Room Library (175 Grayson).

Variable names. SAS programs can now be written with variable names longer than the previous eight-character maximum--in fact, up to 32 characters can be used for both variable and data set names. It's still necessary to begin every name with a character or the underscore '_', and names cannot have spaces, hyphens, and a few other special characters. If you limit variable and data set names to contain a combination of letters, numbers, and underscores only, you should have few problems (other than remembering how to spell long names!).

Note: Many variable names from data sets produced within SAS procedures have changed. If you have programs written for version 6.12 where procedures create datasets, you may need to edit the variable names before the programs will work with Version 8. One way to determine correct variable name spellings is to use PROC CONTENTS on all newly created data sets.

New Data Set Filename Extensions. Version 8 permanent data set file-names are now appended with a new eight-character extension. For example, the V8 filename extension for a data set created on either Darkwing, Gladstone, or Oregon is now .sas7bdat

Full-screen Interface Discontinued. The full-screen terminal interface to SAS is no longer available in SAS 8. If you want to work in a full-screen environment, you will need an X emulator. Contact Microcomputer Services (microhelp@oregon.uoregon.edu) for help in selecting an X emulator for your desktop computer.

New Output Delivery System. The most innovative feature of this new release is the Output Delivery System (ODS). The remainder of this article will briefly describe what it is; however, to use it effectively, you'll need to take the time to practice and explore its possibilities. Version 8's ODS has the potential to revolutionize how SAS is used by opening new ways to conceptualize SAS programming.

What Is the Output Delivery System?

Prior to Version 7, most output generated by SAS procedures (that is, an output listing printed to a *.lis file on Oregon or *.lst file on Darkwing) was designed for a line printer or for viewing with a text editor on a terminal screen.

This type of output often has limitations that prevent users from looking at their results efficiently. For example, many listings were printed in pre-designed formats that could not be modified, and looking for a few numbers often required skimming through pages and pages of information. Now that we have desktop document editors, web browsers, and publishing systems, users require more outputting versatility than Version 6, with its monospaced fonts, provided.

In addition, a few procedures in Version 6 did not produce output data sets or the data required for sequential analysis. If you wanted to use data from one procedure that could not be stored in an output data set as input to a subsequent procedure, you had to rely on PROC PRINTTO to write results to a text file, and then write a DATA step to retrieve these results and use them. This cumbersome process has now been eliminated.

The Output Delivery System (ODS) has been designed to overcome the output limitations of previous SAS versions and to make it easy to apply new formatting options.

In a nutshell, ODS is revolutionary because it allows you to customize your output according to components of your analysis stored in modules called "objects." For example, when running a regression program, parameter estimates and associated significance tests are contained in one object, the ANOVA table is stored in another, and so forth.

ODS can also deliver output in a variety of formats, making the output easy to access. Two of ODS's most important features include:

Listing Choices. Within the same program, ODS can send results to any combination of four destinations, including the usual monospaced listing (the default), a new SAS data set, a high-resolution printer (e.g., PostScript), and a file printed in Hypertext Markup Language (HTML). SAS intends to add more choices in future releases, but this is a great start compared with the single choice available in the past.

Customizing Output. ODS provides tables that define the structure of the output from procedures and from the DATA step. You can customize the way your output is presented by modifying table definitions or by creating your own with PROC TEMPLATE.

The manuals or relevant pages from online documentation can tell you the object names that are created for any SAS procedure. Many objects require that specific options be included on the statements, or they won't be created.

Probably the simplest approach to determine what output objects are available for a given procedure is to use the ODS TRACE statement as shown below:

options ls=78 ps=55 nocenter;
ods trace on / listing;
data mydat;
infile 'mydat.dat';
input group y;
proc univariate data=mydat;

by group;
var y;
run;

ods trace off;
run;

The ODS TRACE statement writes the name, label, template, and path created by the procedure for all available objects and the specific output associated with each into the listing file. You can now select (or exclude) one or more of these individual output objects to send to the destination(s) of your choice.

For example, the listing file from the program above shows that five output objects were created: Moments, BasicMeasures, TestsForLocation, Quantiles, and ExtremeObs.

With these five output objects you can easily create the usual listing output, new SAS data sets, HTML output, or high-resolution printer output.

Using ODS statements. The following program shows how to print three of the five available modules to the listing file and how to create SAS data sets for two of the five modules:

* print the 3 selected objects only to the listing;
ods listing select Moments BasicMeasures Quantiles;
* create output datasets for 2 objects;
ods output BasicMeasures=basic_measures ExtremeObs=extreme_obs;
proc univariate data=mydat;

by group;
var y;
run;

proc contents data=basic_measures;
proc print data=basic_measures;
proc print data=extreme_obs;

run;

The first statement, ODS LISTING SELECT < >; selects 3 of the 5 modules from the PROC UNIVARIATE step to print to the listing file. The ODS OUTPUT statement places 2 of these 5 modules into separate SAS data sets (their names are given to the right of the =) that can be printed or manipulated with subsequent DATA steps or procedures.

Use PROC CONTENTS on each data set to determine variable names, labels, formats, and other information. Don't forget that data analysis from any procedure should always be done by evaluating all relevant information available. For example, extreme observations may greatly affect the summary statistics available with PROC UNIVARIATE. Information available from one object often requires the contents of another object for its proper interpretation.

One of the strengths of ODS is that it removes responsibility for formatting output from individual procedures and from the DATA step. A procedure or DATA step supplies the raw data and the name of the table definition that contains the formatting instructions. ODS can then format the output in a variety of ways.

There are many other statements that make the ODS a powerful new programming tool that are not presented here. The main objective of this article is to show you that traditional SAS output (listing) is only one kind of ODS output; it is no longer the only kind. Unless you specifically close the listing destination, SAS continues to automatically create a listing output in a predefined format.


Fall 2000 Computing News | Computing Center Home Page