U-025 SAS on the RS/6000 and Solaris Platforms

CONTENTS


INTRODUCTION

SAS (Version 8) is a set of computer programs that provides many different statistical procedures within a unified framework. It allows you to run complex analyses without getting bogged down in the details of computations and you can use the procedures without knowing another programming language. SAS does a good job of data management and labeling and provides advanced statistical procedures.

Information Technology, and Communication (ITC) supports the modules:

SAS/ACCESS a family of individual interfaces for linking the SAS System with leading database management systems (DBMS).
SAS/AF provides an object-oriented applications development environment for building highly interactive and intuitive applications driven by graphical user interfaces.
SAS/ASSIST provides the power of the SAS System at your fingertips, regardless of experience level. The software provides a point-and-click interface that guides you to access, manage, analyze, and present data.
SAS/BASE the foundation of the SAS System, providing data access, management, analysis, and presentation capabilities within a powerful applications development environment.
SAS/CONNECT     enables clients running the SAS System (or applications built with the SAS System) to establish communications with one or more SAS applications or programs running in remote environments on different platforms.
SAS/EIS an object-oriented development environment for creating and maintaining highly intuitive enterprise information systems. It offers a code-free development environment that consolidates the SAS System's capabilities for data access, management, analysis, and presentation.
SAS/ETS (Econometrics and Time Series Analysis), provides integrated capabilities for time series analysis and forecasting, econometrics and systems modeling, and financial analysis and reporting.
SAS/FSP (Full-Screen Processing), provides easy-to-use facilities for interactive data entry, editing, browsing, retrieval, and letter writing.
SAS/GIS the SAS System's Geographic Information System software--a highly interactive tool for displaying and analyzing spatially related data.
SAS/GRAPH an information and presentation color graphics tool that can be used to produce charts, plots, and maps in a variety of colors and patterns.
SAS/IML (Interactive Matrix Language), an interactive, high-level matrix language with an extensive set of functions and operators for advanced mathematical, engineering, and statistical applications.
SAS/INSIGHT a dynamic tool for data exploration and analysis. You can explore data through interactive histograms, box plots, scatter plots, and 3-D rotating plots.
SAS/LAB provides guided (prompt-driven) data analysis for meeting the day-to-day analytical and data presentation needs of engineers and research scientists.
SAS/OR a complete set of powerful management science tools. The software includes tools for project management, decision analysis, and mathematical programming.
SAS/QC a set of tools that cover various aspects of statistical quality control, including designing experiments and establishing and improving statistical control
SAS/SHARE enables multiple users to access, read, write, and update the same data sources concurrently.
SAS/SPECTRAVIEW a tool for multidimensional data visualization and modeling. The software enables you to create, analyze, and modify graphical models representing multidimensional data.
SAS/STAT which contains the statistical procedures for statistical analyses ranging from the simple to the complex, including factor analysis, general linear models, and analysis of variance techniques

on the RS/6000 AIX machines avery.med.virginia.edu, blue.unix.virginia.edu, and ptolemy.gis.virginia.edu and on the Solaris machines in the unixlab cluster (the CALC, ENGLISH and TUTOR modules are not part of our SAS 8 license).

To use SAS on RS/6000 or Solaris machine, you need to know how to log on and how to use the Unix operating system. Most SAS users will find it useful to know how to use a text editor such as Pico (ITC recommended editor), JOVE or Vi.


DOCUMENTATION, PUBLICATION and ON LINE INFORMATION

Before you use SAS on the RS/6000, you may want to refer to the local document U-002, Introduction to Unix. Additional printed documentation may be obtained for loan from the ITC Research Computing Support Center (244 Wilson Hall, 243-8800), for purchase from Professor Publishing, University of Virginia Bookstore or from SAS directly.

On Line Help for SAS 8 is available via ITC Web or at the SAS Web Site.

Additional information on SAS at UVa (including information on how to obtain a copy of the software) can be found at:

http://www.itc.virginia.edu/research/sashelp.html

The SAS tutorial (used in ITC's short course) can be found at:

http://www.itc.virginia.edu/research/sastraining/

X Windows SAS users may want to refer to document U-014, Introduction to the X Window System.

And finally, additional help and information for the SAS program can be found by typing man sas to access the manual page for SAS or from the comp.soft-sys.sas newsgroup.


SUPPORT

The Statistical Consultants at the Research Computing Support Center (244 Wilson Hall, 243-8800) are familiar with the SAS program. They can help you with SAS syntax problems. They cannot interpret statistical results and may have difficulties with using complex statistical procedures. A statistical computing consultant is available for help with selection of statistical procedures, construction of your job, and interpretation of your statistical results. To make an appointment with a statistical computing consultant, send electronic mail to res-consult@virginia.edu or call the ITC Research Computing Support Center at 243-8800.


PREPARATION

Logins

The unix version of the SAS package resides only on the RS6000's named avery, blue, ptolemy, and on the unixlab Solaris machines. You must have an account on one of these machines to run SAS. To obtain an account on blue.unix visit:

http://www.itc.virginia.edu/accounts

For information on obtaining an account on the unixlab Solaris machines contact the Research Computing Support group via email to res-consult@virginia.edu

If you are logging on to one of these machines via telnet from an ITC PC lab, select the "Secure CRT" option from the Communications menu and select the machine from the list of host computers. When you are connected, enter your login id and your password. For more information on how to log on and use the RS/6000s and Solaris machines, please see ITC's documents U-002, Introduction to the the Unix Operating System and U-001A, UVa's Unix Menu System (Umenu). These documents are available from the ITC Help Desk and on-line in ITCWeb at:

               http://www.itc/virginia.edu/desktop/unix/docs/u002.unix.intro.html
or
               http://www.itc/virginia.edu/desktop/unix/docs/u001a.umenu.html

Customization for X Windows

For information on using SAS from within the X Window System, please see ITC's documents U-014, Introduction to the X Window System and U-014A, More about X Windows. These documents are available from the ITC Help Desk and on-line in ITCWeb at:

               http://www.itc.virginia.edu/desktop/unix/docs/u014.xwindows.html
or
               http://www.itc.virginia.edu/desktop/unix/docs/u014a.xwindows.html

For information on customizing the SAS X Windows interface, review chapter 4, Using the SAS System under the X Window System, in the manual SAS Companion for the UNIX Environment and Derivatives available for reference in the ITC library; call the ITC Research Computing Support Center for directions.

Config and Autoexec Files

If you would like to permanently customize your sas session, you may copy the files /sas8/sasv8.cfg and /sas8/autoexec.sas to your home directory (thought it is not generally recommended that. you copy the sasv8.cfg file). If you choose to copy these files, check the originals from time to time to see if any changes have been made.

SAS command line options in your sasv8.cfg and autoexec.sas files will be recognized when the sas command is issued.


USAGE

SAS can be used in several ways on the RS/6000 and Solaris machines. You may run SAS interactively in two modes: using the Display Manager System (DMS) in an X windowing environment or using interactive line mode. Either interactive mode allows you to execute your procedures as you type them.

Non-interactive mode allows you to collect all of your data manipulations and procedures into a file that is then processed by SAS. Non-interactive jobs may be run in the foreground or background.

Interactive - SAS Display Manager System for X Windows

To invoke an interactive SAS session using the Display Manager System (this is only available within the X environment), type

               sas <CR>

Five SAS Display Manager windows will appear, including a Program Editor Window (SAS commands may be entered, edited and run in the Program Editor Window), a SAS Log window (which contains information on the current SAS session), and an Output Listing window (where the results of SAS commands may be viewed), a Results Window (which allows you to view outout) and an Explorer Windows (which allows for navigation and the creation of shortcuts). The X Windows interface to SAS also contains a SAS Toolbox Bar which is specific to the active window.

Move the cursor to the first line of the SAS Program Editor to enter SAS program statements. To execute the statements, from the "Run" menu select the "Submit" option, and output should appear in the SAS Log window and in the SAS Output Listing window. If your SAS statements include the line

               goptions device=XBW;
or
               goptions device=XCOLOR;

a SAS Graph window with graphics output will also appear. Use the XBW designation for monochrome (black and white) X terminals and XCOLOR for color X terminals. For more information, see the section on SAS/GRAPH.

On-line help is available from all menus, and pop-up menus provide a simple interface to choices at all menu levels. To save the contents of an interactive window, use one of the "File" menu "Save" options. To exit an interactive session from an X terminal, invoke the "File" pop-up menu from the SAS Program Editor menu, select the "Exit" option and confirm with the "OK" button.

Non-Interactive Mode

Non-interactive mode can be used to process files of SAS commands that have been created with one of the text editors (Pico, JOVE or Vi). Command statements cannot exceed 80 columns, but they can be continued on another line and terminated with a semicolon. The suffix sas is required for the command file name. To run the SAS job, type the name of the input file following the SAS command. For example,

               sas myprog <CR>

processes all the commands in the file myprog.sas, places the results in the file myprog.lst, and creates a SAS log in the file myprog.log. To use other file names, invoke the -print and -log options.

To run SAS as a background process (denoted by the ampersand), create a SAS command file as above, then execute it with a command similar to:

               sas myprog& <CR>

Other Unix commands that can also be used with background processes include nohup and at. To run a SAS program in non-interactive mode and have it continue to execute after you log off, insert the command nohup (meaning "no hangups") at the beginning of the command line, as in:

               nohup sas myprog& <CR>

To schedule a SAS non-interactive program to execute at one minute before midnight, enter

               echo 'sas myprog' | at 23:59 <CR>

For further information about the at, echo, and nohup commands, consult the man pages.

Data Exploration with SAS/INSIGHT for X Windows

SAS/INSIGHT can only be run within X Windows. SAS/INSIGHT provides graphical data analysis with tables, bar charts, x-y scatter plots, and 3-D rotating graphs. SAS/INSIGHT is started by selecting the "Solutions " menu option then choosing the "Analysis" pop-up menu, from which you may select "Interactive data analysis".

You will be presented with a menu that allows you to select the data file or data set for analysis. The data set from the current SAS session may be chosen from the WORK library. Once a file is selected, the rows and columns of that data set will be graphically displayed on the screen.

From the "Graph" menu, bar charts, scatter plots, or rotating plots can be selected. From the "Analyze" menu, graphs and tables can be chosen for distributions, fits, and multivariate analyses. Variables from the specified data set are selected from a list for analysis by pointing and clicking with the mouse.

Customization of graphs is provided with the "Palettes" menu option, and on-line help is made available by pressing the "Help" button on the SAS/INSIGHT menu. To exit SAS/INSIGHT, from the "File" pop-up menu select the "Exit" option and confirm with the "OK" button. You will be returned to your SAS session.

Graphics Output with SAS/GRAPH

SAS/GRAPH generates numerous types of graphs in a variety of terminal and printer formats, including PostScript. Available types of SAS graphs include: horizontal bar charts, vertical bar charts, pie charts, star charts, scatter plots, needle plots, interpolated plots, bubble plots, geographic maps, choropleth maps, prism maps, text graphs and slides, contour plots, 3-dimensional block charts, 3-dimensional scatter plots, and 3-dimensional surface plots. For complete information on generating each type of graph, see the manuals SAS/GRAPH Software, Vol. 1 & 2. Also refer to the end of this document for how to get an example of a graphic PostScript output file.

If you use a map data set provided by SAS to generate a graph, you must copy a compressed version of it from the directory /sas/maps to your own directory and uncompress it there. For example, to use the SAS map in the file /sas8/maps/states.sas7bdat (gzipped form),

               cp /sas8/maps/states.sas7bdat.gz . <CR>

               gunzip states.sas7bdat.gz <CR>

After a map file is moved to your directory, SAS programs that use the map must reference your current directory (denoted by a period) as the source for the uncompressed map file with a SAS program statement such as:

               libname maps '.';


EXAMPLES

Local Example Files

The following is a list of SAS programs developed within ITC:

To run a non-interactive SAS session using the first example, type

        sas example1 <CR>

New output files example1.lst and example1.log will be created, and they may be viewed with the commands:

        more example1.lst <CR>

        more example1.log <CR>

To run the first example program in interactive full screen mode, enter

        sas <CR>

At the cursor next to the Command ===> prompt, enter the following SAS statements and observe these results:

include example1 <CR>   SAS statements are loaded into the Program Editor window
submit <CR> Statements are executed and cursor jumps to Output Listing window
top <CR> Cursor moves to the top of the Output Listing window
forward <CR> Output Listing window scrolls forward by one screen
back <CR> Output Listing window scrolls back by one screen
bottom <CR> Cursor moves to the bottom of the Output Listing window
end <CR> Cursor jumps back to the Program Editor window

From the Program Editor window, the program may be edited and resubmitted for execution. When ready to exit the interactive session, from any window command prompt enter

        endsas; <CR>

To run the first example program in interactive mode using the X interface (you need to be working within the X windowing environment), type the command:

        sas <CR>

From the SAS Program Editor menu, select the ``File,'' ``Open,'' and ``Read File'' options. Either enter the file name example1.sas or select it from the directory list, then confirm your selection with the ``OK'' button. Select the ``Run'' pop-up menu, and select ``Submit.'' The SAS statements will be executed, and the output will appear in both log and output list windows on the terminal. Use the scroll bars to browse through the output in either window. To exit the interactive X session, from the ``File'' pop-up menu of the SAS Program Editor menu select the ``Exit'' option and confirm with the ``OK'' button.

  • To run the first example using interactive line mode processing, enter the following commands:

            sas -nodms <CR>

            %include 'example1.sas'; <CR>

    The SAS program statements will be printed on the screen, and they will be automatically executed. The log and listing output will be intermingled on the screen. You may modify the statements from the example or add lines to the program for execution. To exit the interactive line mode, enter the command:

            endsas; <CR>

    You may want to get a copy of the SAS short course notes from Professor Publishing, University Bookstore and use the example files in conjunction with those notes.

    SAS Sample Files

    SAS sample files are distributed along with the SAS system. These files are located in the subdirectories applet, base, connect, dbi, eis, ets, gis, graph, iml, insight, or, qc, share, spectraview, and stat within the directory /sas8/samples. To copy the sample file /sas8/samples/stat/pearson.sas to your account and execute it in non-interactive mode, enter

                   cp /sas8/samples/stat/pearson.sas . <CR>

                   sas pearson <CR>

    SAS/GRAPH Example PostScript Figure

    The local sas file fig1.sas, is a sample SAS/GRAPH program that generates a PostScript figure. To execute the SAS program and spool the output file fig1.ps to a PostScript printer, enter these commands:

                   sas fig1 <CR>

                   lpr fig1.ps <CR>

    Note that the graphics output can be redirected to a graphics terminal with the following program modifications to fig1.sas:

    1. Remove the filename statement.
    2. Remove the gaccess, gsfmode, and gprolog lines from the goptions statement.
    3. In the statement ``device=PS;'' replace PS with the name of the graphics terminal you are using.

    Set device=XBW for monochrome (black and white) X terminals. Set device=XCOLOR for color X terminals. If you are using a terminal that can emulate a TEKTRONIX 4014 graphics device (as with NCSA Telnet in ITC's microcomputing facilities), set device=TEK4014. If you initiate TEK4014 graphics with emulation through NCSA Telnet, remember to revert to text mode with the HOME key or ALT-R command.


    © 2008 by the Rector and Visitors of the University of Virginia.

    The information contained on the University of Virginia’s Department of Information Technology and Communication (ITC) website is provided as a public service with the understanding that ITC makes no representations or warranties, either expressed or implied, concerning the accuracy, completeness, reliability or suitability of the information, including warrantees of title, non-infringement of copyright or patent rights of others. These pages are expected to represent the University of Virginia community and the State of Virginia in a professional manner in accordance with the University of Virginia’s Computing Policies.