Header image: Architectural widgetsSociology at Duke
Navigation Bar: Resources

Research and Training

Sociological Sites

Computing Resources

Departmental Publications

University Libraries

Quick Links

  
 

SAS

Description: SAS is a general purpose, commercial statistical package and high level data management programming language from the SAS Institute, Cary, NC. With many capabilities beyond statistical, SAS is widely used in academia and industry.

Availability: UNIX version 8.2 on compute servers paradigm and charisma. Version 6.12 is also available on server charisma. Windows version 8.2 is on selected PCs connected to the departmental LAN.

Documentation: SAS Version 8 documentation from Duke IPs is available online in two formats:

Bob Jackson consults on SAS programming questions and maintains an extensive collection of SAS manuals which may be consulted as needed. Personal copies of manuals may be purchased from the Gothic Book Shop or directly from the SAS Institute Publications (800-727-3228). Detailed introductory SAS notes for UNIX or Windows are available from Bob Jackson.

Additional Help and Information: The SAS page of the Social Sciences Computing site has pointers to additional web resources.

Modes of Usage Under UNIX: SAS may be run in interactive or batch mode. Interactive mode requires that you be logged into the UNIX system via an SSH terminal program and that you have a PC X-server program loaded such as X-Win32.

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

    xsas &

This will load an iconified x-terminal window from which SAS launches. This method of invoking SAS 8.2 circumvents a flaw in the interaction of SAS 8 releases with the X-Win32 PC X-server. A bug in X-Win32 that causes this may eventually be corrected.

The amperand (&) causes the UNIX prompt to remain available in the window from which SAS was invoked. Four display windows appear. The "Program Editor" window is used for program editing and submission. The "Log" window displays listings of executed programs with associated notes, warnings and error messages. The "Output" window displays output from SAS reporting procedures. The "Toolbox" window provides a set of icons used as shortcuts for performing certain "Program Editor" functions.

To load interactive SAS 6.12 change to your working directory and type:

    sas6 &

NOTE: SAS 6.12 is a deprecated version which is available as a convenience. SAS system files created on server charisma under version 6.12 are not usable on server paradigm or portable to Windows SAS. All existing 6.12 system files should be upgraded to version 8 format, which allows cross-platform portability. This can be done by accessing version 8.2 on charisma and saving in version 8 format or by using the DBMS/Copy file transfer utility to convert to version 8 format.

When printing from the log or output windows of SAS 8.2, select File | Print. This will open the following print dialog box.

Click the Use Forms box in the upper, left corner. The box will morph as follows:

You will see that form printing has been pre-defined for standard, 2-up printing with the enscript facility. Note, in the second box of this dialog, that the default printer is set to copy2. If you prefer an alternative printer, just change it to clus or copy3. Click OK to print. After you have selected forms printing once, SAS will default to this mode and always display the second screen immediately.

Under UNIX, many prefer to run SAS in batch mode. Batch submission entails loading SAS from the command line along with a SAS program. SAS executes the program in the background and writes the results to separate files without bringing up any windows. This is quite convenient if you are logged in from home over a connection which does not provide for X-windowed displays. It is also possible to submit long-running batch jobs, logoff and login later to check their status.To run a SAS program in batch requires that you have previously written the program and saved it in a text file.

Assuming the existence of a program called "recodes.sas", one would run the program in SAS 8.2 by typing at the UNIX prompt:

    sas recodes.sas &

To run the same program is SAS 6.12 type:

    sas6 recodes.sas &

SAS executes the program in the background and writes in 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". UNIX SAS batch output is typically printed with the enscript command, as in the example below which prints the output files to the Copy Room printer:

    enscript -2r recodes.log recodes.lst

Licensing for Personal Use: Annual SAS for Windows licenses may be obtained from the OIT Site License Office for use on personally owned laptop or desktop PCs. The licensing fee is $35 per year plus the cost of installation CDs ($15). Licenses expire at the end January, with a 90 day grace period following expiration. Users wishing to avoid media costs may borrow installation CDs from Bob Jackson with proof of license purchase.


People Graduate Program Undergraduate Program Resources Home Duke University Home