Unix SAS Quickstart

The purpose of this document is to get you up and running Unix SAS quickly, and ready to begin learning to use SAS statistical software.

In order to run SAS version 8.1 as supported at WPI, you need to (1) copy several files into your home directory and (2) configure SAS for printing and accessing macros. The following eight steps will accomplish (1) and (2).

  • Step 1: Log in to a computer that runs Unix SAS 8.1. If you log in from the stat lab, you will be on the server parabola, which runs Unix SAS 8.1. Other computers that run Unix SAS 8.1 include mathlab and wpi. If you are logging in from a PC, you must use an X-Windows emulator such as PC-Xware.

  • Step 2: Copy SAS configuration files. In this step, you will copy three files to your home directory. These files will (1) initialize Unix SAS to allow you to find existing libraries of SAS data files, (2) set graphics parameters, and (3) set up your default printer for printing from the SAS Graphics Window. There are usually two printers in KH 207, stat1 and stat2, but stat1 is broken at present, so you will be printing to stat2. The section Changing Your Graphics Printer, found in the document An Introduction to SAS/EIS, tells how to change your default printer for printing from the SAS Graphics Window.

    To copy the SAS configuration files, type

    > /math/mathlab/bin/sasetup8b

    (Note: the ">" is the prompt supplied by the computer; you just type the "/math/mathlab/bin/sasetup8b" part and hit <enter>.) If the computer responds with anything other than just the prompt, you've probably done this step incorrectly and you should seek help.

  • Step 3: Start SAS. You are now ready to access Unix SAS 8.1. To start Unix SAS, type

    > sas &

    (NOTE: the ">" is the prompt supplied by the computer; you just type the "sas &" part and hit <enter>.)

  • Step 4: Set up SAS Printing You now need to configure SAS to print text from the SAS Output Window and graphs from SAS/INSIGHT (Unfortunately, SAS has two types of printing, which involve two configurations: printing from the SAS Output Window and graphs from SAS/INSIGHT is one type, and printing from the SAS Graphics Window is the other. In Step 2, you configured printing from the SAS Graphics Window).

    Usually, there are two printers in the stat lab: stat1 and stat2, but presently, stat1 is being fixed (we hope). Therefore, you will just set up printing for stat2. Follow the steps below to set up printing for stat2. Later if and when stat1 returns, you can repeat the instructions with appropriate changes to set up printing for stat1. Items a.-c. below will will set up printing to one printer, and will enable you to print to that printer from from the EDITOR, OUTPUT, LOG, or RESULTS windows as well as from SAS/INSIGHT. You will have to do these items a second time to set up printing to both stat1 and stat2.

    The same steps will set up printing from the two printers in the math lab in SH 306: math3 and math3b.

    a. Choose either the EDITOR, OUTPUT, LOG, or RESULTS window.
    b. From the chosen window, click on File: Print Setup.
    c. A SAS: Print Setup window will appear. Click on New. You will have to navigate through a sequence of five dialog boxes. Respond to them as follows:
    Box 1: Give a name to identify the printer: stat2. Click Next.
    Box 2: Select the model to be HP LaserJet 4 PCL. Click Next.
    Box 3: Tell where to route the output.
    i. First select Device type Pipe.
    ii. Then give a path to the printer: /usr/local/bin/lpr -h -Pstat2 Click Next
    Box 4: Leave the previewer input field blank. Click Next.
    Box 5: Click Finish.

    To exit the setup, click OK.

  • Step 5: Set up EIS applications.
    1. Choose Solutions:EIS/OLAP Application Builder from the menu bar on any of the original SAS windows (PROGRAM EDITOR, LOG, OUTPUT, RESULTS or EXPLORER).
    2. From the resulting window, select Applications.
    3. A small SAS/EIS: Applications window will appear. Click on Set applications....
    4. A SAS/EIS: Set Applications window will appear. Click on Primary private application....
    5. A SAS/EIS: Primary Private Application window will appear. Click on the Library: field and input eisapps, then hit the tab key. In the Application database: field input eisapp, then hit return. Click on OK, and then Goback twice. This returns you to the SAS/EIS main menu.
    6. Close the SAS:EIS window by choosing File: Close.
    Note: You have to do this setup only once, ever.

  • Step 6: Printing from the GRAPHICS window. Some graphical output, such as those produced by macros you will use in labs, is displayed in the SAS/Graphics window. Printing from this window requires no new setup, but is a little different than printing from the other windows or from SAS/INSIGHT. The following will take you through the steps needed to print from the graphics window.
    a. Generate a graph by running the program PLOT_EG from SAS/EIS. (From the menu bar of any of the original SAS windows, choose Solutions:EIS/OLAP Application Builder:Applications: Run private application...:PLOT_EG).
    b. A graphics window will appear with a graph in it.
    c. Click on File:Print from the graphics window.
    d. A SAS Print dialog box will appear. Make sure Use SAS/Graph Drivers is selected. There will be a Driver selection window immediately below. Clicking on the triangle to the right will display a list of drivers. If you want to print your graph in portrait mode, select the driver PS (PostScript devices) from the list. If you want to print your graph in landscape mode, select PSLL (PostScript devices-landscape n).
    e. Click OK, and see what gets printed.

    When printing from the graphics window, you will always have to go through steps d.-f.

    You cannot change your printer at the SAS/GRAPHICS window, as you can in SAS/INSIGHT, or in the other SAS windows. Directions for changing your printer for printing from the SAS/GRAPHICS window are found in the section Changing Your Graphics Printer, in the document An Introduction to SAS/EIS.

  • Step 7: Access SAS/INSIGHT. From the menu bar on any of the original SAS windows select Solutions: Analysis: Interactive Data Analysis. A SAS: SAS/INSIGHT: Open window will appear.
    If you want to key in a set of data, select New. A blank SAS/INSIGHT spreadsheet will appear. For details on entering data into SAS/INSIGHT, see the section Creating New Data in the document An Introduction to SAS/INSIGHT I: Elementary Concepts.
    If you want to read an existing SAS data set into SAS/INSIGHT for analysis, select Open. This will bring up a dialog box with choices for SAS data libraries. Among these are:
    o The WORK library. This is the temporary library. All SAS data sets in this area will be erased when you finish your SAS session.
    o The SASUSER library. This is your personal permanent library.
    o The SASDATA library. This is a permanent library of data sets which are accessible to all users. Data for homework assignments will often be found in the SASDATA library.
  • Step 8: Log out of SAS. When you are finished with your SAS session, please log out of SAS. You may do this by using the "SAS Session Management" icon located on your desktop. Double clicking on this icon, or clicking once on this icon and then on "Restore", will produce the SAS Session Management window. Click on the "terminate" box in the SAS Session Management window to terminate your session.

    Other Important Stuff

    Where to learn more about SAS

    For those of you taking a statistics course, your instructor and TA are primary sources for information about SAS. Another resource is email to ma-questions.

    All SAS documentation is available online at http://www.math.wpi.edu/saspdf in the form of pdf files. For those of you taking the introductory courses, MA 2611/12, the only one of these documents likely to be of interest or use is the SAS/INSIGHT User's Guide.

    So SAS isn't behaving, and you don't know why?

    In general, SAS is a pretty reliable program, but there are times when it just seems to have behavior problems. By behavior problems, we don't mean things you may have done, like click on the wrong button, or input the wrong type of response in a macro (like 37.5 when a Y/N was asked for). We mean really strange unexplained phenomena, like the recent example of a student who typed sas & at the unix prompt and got the message

    ERROR: Generic critical error.

    and no SAS windows. Only when she typed sas & a second time did the SAS windows appear. In cases like these, you can try a number of approaches, among them:
    a. If you are doing a lab, flag down a TA.
    b. Send a message to ma-questions.
    c. If host printing is giving you troubles, try the following:
    i. Make sure the printer that it selected is the one you are trying to print to.
    ii. If trying to print to stat1 or stat2, make sure you are running SAS from parabola. The printers stat1 and stat2 cannot be accessed from most other computers.
    iii. Check the print setup to make sure you have selected the proper destination for the printer (e.g., /usr/local/bin/lpr -h -Pstat1 (or -Pstat2)), and that the device type is Pipe.
    d. Finally, if all else fails,
    i. Exit SAS.
    ii. Delete your profile file (the file profile.sas7bcat in the directory /home/yourid/sasuser.800).
    iii. Restart SAS.

    Bailing out

    Sometimes you run a SAS program or procedure that you realize is both wrong (perhaps you gave it a wrong input) and long. To bail out of the program or procedure, you can use the "SAS Session Management" icon (the one on your desktop with the lightning bolt). Clicking on this icon will produce the SAS Session Management window. Click on the "interrupt" box in the window to stop the program or procedure without ending your SAS session. When all else fails, click on "terminate" to bail out of SAS.

    Where Next?

    You are now ready to begin the SAS tutorials.

    gif Intro page.

    gif Introduction to SAS/EIS, which you'll use to run SAS macros (programs) for labs and specialized applications.

    gif Introduction to SAS/INSIGHT I: Elementary Concepts. This is the minimal tutorial you should do to be familiar with the basics of SAS/INSIGHT, a graphically-oriented data analysis system

    gif Introduction to SAS/INSIGHT II: Advanced Concepts. This tutorial will show you some of the more advanced features of SAS/INSIGHT

    gif Getting Started in the Statistics Multimedia Computer Classroom. (for new users)

    Joe Petruccelli < jdp@wpi.edu>
    Last modified: Mon Oct 29 10:47:21 EST 2001