SAS for Linux

SAS is a general purpose, commercial statistical package and high level data management programming language from the SAS Institute in Cary, North Carolina. SAS is widely used in academia and industry.

Availability

SAS for Linux, Version 9.2 is available on compute server paradigm. SAS Version 9.1.3, Service Pack 4 is available on server verstehen. A Sociology Linux account is required for use.

Access Requirements

Windows users need the following:

Prior to opening a SAS session:

  1. Load X-Win32. This makes X-Window services available on your PC.
  2. Load F-Secure and open a termnal session to paradigm.soc.duke.edu or verstehen.soc.duke.edu.

Mac or Linux users:

Invoking SAS and Submitting Programs

SAS may be run in interactive or batch mode. When learning SAS, interactive mode is preferrable. Experienced SAS users often come to prefer batch mode, especially for complex programs that require hours or days to complete.

Interactive Mode SAS

To invoke interactive SAS, change to the directory in which you wish to work and type:

The SAS splash screen appears momentarily followed by five windows:

Placement of the ampersand (&) after the command returns the command prompt, so that your terminal window can be used for other activity.

The default program editor under Linux SAS is quite different than that of Windows SAS, but it can be reconfigured to behave like the Windows editor. The steps in doing this are described in ["Reconfiguring the SAS Program Editor Under Linux"].

Important Note Regarding Keyboard Behavior: When access is through X-Win32 and an SSH client under Windows, make sure that the NumLock key is toggled off. When enabled the Backspace and Delete keys do not work in the SAS Program Editor.

Batch Mode SAS

Batch mode SAS requires preparation of your SAS program in an editor such as emacs or pico (see ["Linux Editing"]) or your preferred editor under Windows. Then the program is submitted to SAS from the Linux command line. Assume, for example, you have created a program called recodes.sas. [Use of the .sas filename extension is the convention for naming a SAS program.]

To submit this program in batch mode, type:

SAS executes the program in the background and writes to the current directory corresponding log and output files named in tandum with the program file. In this example, the files would be called recodes.log and recodes.lst.

The results of batch execution are conveniently viewed with the less paging command:

The less utility allows you to quickly page through log and output files. Navigation involves simple keystrokes:

General Guideline

Always examine your SAS log carefully, as it contains notes, warnings and error messages that allow you to verify correct program execution or to diagnose problems in syntax or logic. Interactive SAS messages are color-coded: notes in blue, warnings in green and errors in red.

Getting Help

SAS provides documentation through searchable, online tools and through detailed manuals available as downloadable PDF files. The table below organizes some of the more useful documentation links for the 9.1.3 release. The online documentation is quickly searched and provides focused information. The PDFs are more detailed and broader in scope. SAS documentation applies to Windows and Linux unless otherwise noted.

Topic

URL

SAS OnlineDoc 9.1.3 <<BR> Recommend this be bookmarked

http://support.sas.com/onlinedoc/913

Base SAS 9.1.3
List of core PDF documents and pointers into the online documentation for the base product

http://support.sas.com/documentation/onlinedoc/base/index3.html

SAS 9.1 Documentation
All releases - online and PDF

http://support.sas.com/documentation/onlinedoc/91pdf/index.html

Printing

Interactive SAS for Linux printing is normally done from the log and output windows. Simply select the File > Print option in these windows. The first time this is done following SAS: Print... dialog box appears:

Select the Use Forms option at the top of the box. The window transforms to the following:

Select OK to print the item and save this setup.

The default form printing is pre-defined for 2-up printing (two sheets per page) with the enscript printing utility. Note, in the second box of this dialog that the default printer is set to copy2 (the network printer located in the second floor copy room). If you prefer to print to the Room 135 lab, just replace copy2 with lab.

SAS batch output is printed from the command line. Assuming the example SAS job recodes.sas produces log and output files named recodes.log and recodes.lst, they are printed to the default Linux printer (copy2) with the command:

Sending to the alternate lab printer, just requires a printer specification:

For a more in-depth discussion of handling output see Handling SAS Output Under Linux.

Sociology domain users who store Linux SAS programs, outputs and data sets under their lanhome directory have them directly available under Windows when that directory is mapped to a drive letter. So outputs may be viewed, printed or otherwise used from Windows.


Computing Home | Sociology Home | Arts & Sciences Home | Duke Home