Research Computing >> Software >> SAS
UNIX: SAS version 8.2 is currently installed in Kellogg's UNIX server, Skew3, as well as in the DCE/DFS cluster.
MS Windows: SAS version 8 for Microsoft Windows (and for MacOS) is available through a Northwestern site license that requires payment of an annual fee ($100).
SAS is a software package for statistical analysis and data management. It consists of a collection of integrated modules that include tools ranging from data management, statistics and mathematical analysis routines, and a matrix-based programming language to application development tools. Highlights of SAS include its data manipulation capabilities (mostly by reading and writing to disk, instead of holding the data in RAM memory), and the breadth of statistical procedures available. The disadvantage of SAS is its idiosyncratic syntax.
SAS Institute, Inc.
SAS Campus Drive
Cary, NC 27513-2414
Phone: (919) 677-8000
Fax: (919) 677-4444
For online tips and FAQ, see the links below.
You may submit a problem to SAS Technical Support using a web form. You will need specify the site number and operating system; you can obtain this information from your SAS log file.
Every SAS session creates a LOG, where SAS writes any errors and warnings generated by commands issued by the user, and a listing (LST) of output. In batch sessions, the log and listing are written directly to ASCII file that have the same name as the program name, but with extensions "log" and "lst", respectily. In interactive windows sessions, the contents of the LOG and Output windows has to be saved to file manually by the user.
||The command is
To start SAS display manager in X-Windows
To start SAS in interactive line mode
After an initialization message, you will see the SAS line prompt:
To end a SAS interactive line mode session
To run a SAS job ("filename.sas")
To run it in the background:
sas filename &
To run SAS with more RAM memory:
The maximum default is 64MB. To raise the limit to 128MB, for example,
use the "memsize" option when you start SAS:
sas -memsize 128M filename
For more SAS system options, refer to the SAS Unix Environments documentation.
To look at the defaults set for skew3, look at the "sasv8.cfg" file in "/usr/local/sas-8.1".
To supress the creation of a log file:
Route the log to /dev/null using the SAS log system option:
sas -log /dev/null filename &
SAS samples installed with the application: Users of SAS in Skew3 can browse and copy the samples by going to the "/usr/local/sas-8.1/samples". Users who have installed SAS on their Windows desktop machine will find samples within the directory for each module of SAS. For example, you will find samples for SAS/Stat under "c:\Program Files\SAS Institute\SAS\V8\STAT\SAMPLE". The exact location of the 'SAS Institute' directory depends on the choices made during the installation.
The sample programs from many of SAS' publications is available online in SAS Online Samples.
ASCII-based display manager in UNIX: Version 8.1 does no longer provide an ASCII-based display manager. Users accessing Skew3 without an X-Windows emulator can either submit SAS jobs in batch or use the interactive line mode.
Moving SAS data files between MS Windows and UNIX or between different versions of SAS: Version 8 files (extension ".sas7bdat") are binary files that can be read by the UNIX and Windows versions of SAS release 8, indistinctly. Earlier versions cannot be moved across operating systems without conversion (using the XPORT library or the CPORT procedure). SAS release 8 can read files from earlier versions (same platform) if the corresponding library engine is specified. For example, SAS 8.1 in UNIX can read SAS 6.12 data files (extension ".ssd01") generated in another UNIX system by specifying the V612 library engine (libname libref v612 'path';).
"Bug" in PROC EXPORT: The EXPORT procedure, which can be used to translate a SAS data file into CSV, DBF and other formats has a problem under version 8. The problem is that even in batch mode these procedures try to display the SAS Session Manager icon, which requires a valid X display. SAS 6.12 was able to work around this because the -fsdevice ascii option was available. This option is no longer available in version 8. The alternative option for batch job in SAS V8 is "
sas -noterminal filename".
Setting default options for a SAS session ("autoexec.sas"): Users may create a file called "autoexec.sas" in their home directory and include in it any valid SAS statement or option. This file is executed by SAS immediately after it initializes. Thus, it is a convenient tool to avoid issuing LIBNAME and OPTIONS statement that are used in every program. For example, the following lines could be placed in an "autoexec.sas" file, allowing the user to refer to these libraries in any SAS program:
options ls=80 nocenter nodate;
libname mywork '~/research';
libname oldfiles v612 '~/sasv6files';
Note that SAS system options (memory size, sort size, work directory, etc) will not be executed within a SAS program. These options must be specified before SAS initializes, either from the command line or by pointing to an alternative SAS configuration file (see example about memory size above).
Cannot read SAS version 8 (*.sas7bdat files) files created by DBMS/Copy: There is a bug in DBMS/Copy which writes SAS files specifying a format not recognized by SAS version 8. In order to read the data in SAS, in your SAS program include the NOFMTERR system option (OPTIONS NOFMTERR;). SAS will issue a warning, but it will read the data.
Suppressing the log file: In Unix, to supress the creation of a SAS log file altogether, send the log to the null device, /dev/null. For example:
sas -log /dev/null your_program
Tips for saving space in your Unix account:: SAS offers a macro called "%squeeze". Refer to the SAS Technical Tip "%SQUEEZE-ing Before Compressing Data". Also, you may look into the SAS COMPRESS option.
Sample programs at Kellogg
Note: A complete set of SAS reference documentation (all the base and module manuals) is available online.
- SAS Language. Reference (version 6, Sep. 1995 -- 2 copies)
- SAS Procedures Guide (version 6, 3rd edition, Jun. 1995)
- SAS Language and Procedures. Usage (version 6, Dec. 1989)
- SAS Language and Procedures. Syntax (version 6, Jan. 1991)
- SAS/STAT User's Guide, Volume 1 & 2 (version 6, Jun. 1994)
- SAS Companion for the Microsoft Windows Environment (version 6, Jun. 1996)
- SAS Companion for UNIX Environments: User Interfaces (version 6, Sep. 1993)
- SAS Companion for the UNIX Environment and Derivaties (version 6, 1990)
- SAS Guide to Macro Processing (version 6, June. 1995, 2nd edition)
- Getting Started with the SQL Procedure (version 6, Jan. 1995 -- 2 copies)
- SAS/IML. Usage and reference (version 6, Dec. 1995)
- SAS/GRAPH Software, volumes 1 & 2. Reference (version 6, mar. 1996)
- Master Index to SAS Documentation (version 6, Oct. 1992, 4th edition)
Version 8: documentation and changes
- Getting Started with the SAS System, version 8 (Sep. 1999)
- What's New in SAS Software for Release 8.1 (Apr. 2000)
- SAS/ETS Software: Changes and Enhancements, release 8.1 (May 2000)
- SAS/IML Software: Changes and Enhancements, Release 8.1 (May 2000)
- SAS/STAT Software: Changes and Enhacements, release 8.1 (May 2000)
- SAS Institute (2000), SAS SQL Procedure User's Guide, Version 8
Books on special topics and programming:
The books in the following list contain a wealth of examples applied to specific types of problems. These books are not online, but the code samples can generally be downloaded from the SAS Institute.
- Aster, Rick (1992). Professional SAS User Interfaces. Windcrest/McGraw-Hill.
- Aster, Rick and Rhena Seidman (1991). Professional SAS Programming Secrets. Windcrest/McGraw-Hill.
- Boehmer, Ekkehart, John Paul Broussard and Juha-Pekka Kallunki (2002). Using SAS in Financial Research.
- Carpenter, Art (1998). Carpenter's complete guide to the SAS macro language.
- Cody, Ron (2001). Longitudinal data and SAS. A programmers guide.
- Cody, Ron (1999). Cody's data cleaning techniques using SAS software.
- Cody, Ronald P. and Jeffrey K. Smith (1991). Applied Statistics and the SAS
Programming Language. Prentice Hall, 3rd edition
- Freindly, Michael (1991). SAS System for Statistical Graphics. SAS Institute
- Freund, Rudolf J. and Ramon C. Littell (1995). SAS System for Regression. SAS
Institute, 2nd edition (2 copies).
- Hatcher, Larry and Edwards J. Stepanski (1994). A Step-by-Step Approach to Using
the SAS System for Univariate and Multivariate Statistics. SAS Institute
- Hatcher, Larr (1994). A Step-by-Step Approach to Using the SAS System for Factor
Analysis and Structural Equation Modeling. SAS Institute
- Jaffe, Jay A. (1996). Mastering the SAS System. Thompson Computer Press, 2nd edition.
- Khattree, Ravindra and Dayanand N. Naik (1995). Applied Multivariate Statistics with the SAS Software. SAS Institute
- Littell, Ramon C., Rudolf J. Freund and Philip C. Spector (1991). SAS System for
Linear Models. SAS Institute, 3rd edition.
- Littell. Ramon C., George A. Milliken, Walter W. Stroup, Russell D. Wolfinger (1996). SAS System for Mixed Models. SAS Institute.
- Miron, Thomas (1995). The How-to Book for SAS/Graph Software
- SAS Institute (1994). Stock Market Analysis Using the SAS System: Portfolio Selection and Evaluation.
- SAS Institute (1995). Stock Market Analysis Using the SAS System: Technical Analysis.
- SAS Institute (1995). Combining and Modifying SAS Data Sets: Examples
- SAS Institute (2001), Categorical Data Analysis Using Logistic Regression Course Notes
- Stokes, Maura E., Charles S. Davis and Gary G. Koch (1996). Categorical Data
Analysis Using the SAS System. SAS Institute
- Stokes, Maura E., Charles S. Davis and Gary G. Koch (2000). Categorical Data Analysis Using the SAS System, 2nd. edition.
Other manuals and technical reports:
- Client/Server Computing with the SAS System. Tips and Techniques (Sep. 1995 -$
- Getting Started with SAS/ACCESS Software (version 6, Dec. 1995)
- Getting Started with SAS/EIS Software (version 6, Jul 1995)
- Getting Started with the FRAME ENTRY. Developing Object-Oriented Applications
(version 6, Jun. 1993)
- Highlighting SAS/SPRECTRAVIEW Software (version 6, April 1994)
- SAS Software Consultant's Guide for the SAS System. SAS Technical Report U-113
(Mar. 1990 -- 2 copies)
- SAS Guide to the SQL Query Window. Usage and Reference (version 6, Sep. 1995)
- SAS Screen Control Language. reference (version 6, dec 1994, 2nd edition)
- SAS/ACCESSS Software for relational Databases Reference (version 6, Jul 1994)
- SAS/AF Software. FRAME Application Development Concepts (version 6, Oct. 1995)
- SAS/AF Software: FRAME Entry. Usage and reference (version 6, Mar. 1993)
- SAS/ASSIST Software System Administrator's Guide, version 8 (Oct. 1999)
- SAS/CALC Software. Usage & Reference (version 6, Apr. 1995)
- SAS/CONNECT Software. Usage and Reference (version 6, Aug. 1994, 2nd edition)
- SAS/EIS Software: Reference (version 6, Oct. 1995, 2nd edition)
- SAS/ENGLISH Knowledge Base Administrator's Guide (version 6, Apr. 1994)
- SAS/ENGLISH Software Advisor: KBA Practical Advice (Oct. 1994)
- SAS/ENGLISH User's Guide (version 6, Jul. 1994)
- SAS/GIS Software. Usage and Reference (version6, Oct. 1995)
- SAS/INSIGHT User's Guide (version 6, 3rd edition, feb. 1996)
- SAS/OR Users's Guide: Project management (version 6, Apr. 1993)
- SAS/OR Users's Guide (version 6, May 1990)
- SAS/OR Software: Changes and Enhancements, release 8.1 (May 2000)
- SAS/QC Software: Changes and Enhancements, release 8.1 (May 2000)
- SAS/QC Software. Usage and Reference. Volumes 1 & 2 (version 6, Apr. 1995)
- SAS/SHARE Software. USage and Reference (version 6, Mar. 1995)
- SAS/SHARE Technical report for UNIX Environments (release 6.11, Aug. 1995)
- Transporting SAS Files between Host Systems. SAS Technical Report P-195
- SAS/STAT Software: The GENMOD Procedure. SAS Technical report P-243 (release
6.09, Apr. 1993)
- SAS/STAT Software: the MODECLUS Procedure. SAS Technical Report P-256 (release
6.09, Sep. 1993)
- SAS/STAT Software: The PHREG Procedure. SAS Technical Report P-217 (version 6,
Help from SAS Institute: The SAS web page provides many samples and useful articles about its products. The best access point to the SAS Institute web pages is the Service and Support page. Noteworthy links in the latter page are:
News groups and listservs: The following is a short list of SAS help/discussion sources independent of SAS Institute. Both are followed by SAS experts in different disciplines (including SAS personnel), and thus are good fora to ask a programming question
- SAS news group, news:comp.soft-sys.sas
- The SAS listserv, SAS-L is mirrored by several other listservs; from the link above you may browse and search the archives. You may also subscribe to the listserv, which has a lot of traffic. SAS-L messages can also be seen in the news group.
Tutorials at other universities: