An Introduction to UNIX SAS Version 8.1 at WPI
This document has several purposes:
- To get novice users of SAS statistical software in the Unix
environment up and running as quickly as possible.
- To impart basic proficiency in the use of
SAS statistical software.
- To serve as an introduction to the computing environment at WPI
in general, and particularly to the Statistics Multimedia Computer
Classroom in KH 207 (known in the rest of this document by its
alias, "the stat lab").
- To introduce Unix computing at WPI.
Unix SAS Update and Quickstart contains
information on the latest changes in Unix SAS software and its
implementation at WPI. By following the steps in this section, new
users will configure their Unix accounts for running SAS and
accessing SAS data sets and macros used in statistics course work at WPI.
WPI is currently running release 8.1 of SAS.
An Introduction to SAS/EIS and
An Introduction to SAS/INSIGHT I: Elementary Concepts
are tutorials designed to
introduce the novice SAS user to two components of SAS statistical
software: SAS/INSIGHT, a graphical environment for interactive data
analysis, and SAS/EIS, a component of SAS that is used as an
interface between the user and a set of SAS programs, called macros,
that are used in statistics courses at WPI. Users who want to do
more with SAS/INSIGHT are invited to the continuation of the tutorial
found at
An Introduction to SAS/INSIGHT II: Advanced Concepts.
The purpose of this section is to get you up and running quickly, and
ready to begin learning to use SAS statistical software.
Unix SAS is available on many DEC Alpha servers on campus, including
statlab, mathlab, wpi, and
reno. It may be accessed on these machines from any
workstation, X-terminal or PC on the WPI network.
Unix is the operating system used on workstations at WPI. For those of you
familiar with PCs, Unix is to workstations what DOS (or Windows NT or
2000) is to PCs.
Users unfamiliar with Unix will find links to introductory information
in the
Basic Unix Information. section of this document.
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 statlab, which runs
Unix SAS 8.1. Other computers that run Unix SAS 8.1 include
mathlab, wpi, and reno. 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. About half of the class
(determined by birth date) will be asked to copy one set of files
and
the rest of the class will be asked to copy another set. The
first set
of files assigns one of the printers in the KH
207 as
default for printing from the SAS Graphics Window, and the other
set
assigns the second printer. This procedure
will help to avoid long waits for printed output.
The section
Changing Your Graphics Printer, found later in this
document, tells how to change your default printer for printing
from the SAS Graphics Window.
If your birthday is between the dates July 1 and December 31
inclusive, do a. Otherwise do b.
- a. Type
> /math/mathlab/bin/sasetup8a
(NOTE: the ">" is the prompt supplied by the computer; you just
type the "/math/mathlab/bin/sasetup8a" 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.
- b. 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 (in Step 2, you configured printing from the SAS
Graphics Window).
There are two
printers in the stat lab. Their names are stat1 and stat2. We
recommend that you set up printing for both, so that you can
direct output to the less busy one (or the one that hasn't
run out of paper). Follow the steps below to set up printing
for one of them, and then repeat the instructions with
appropriate changes to set up printing for the
other. 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: stat1 or
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:
- If you defined stat1 as the printer in Box 1, the path is
/usr/ucb/lpr -h -Pstat1
- If you defined stat2 as the printer in Box 1, the path is
/usr/ucb/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: Practice 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 graphics window by clicking on View: Graph
from
any of the original SAS windows. (Note: In real applications, the
graphics window will appear automatically with a graph in it.)
- b. If a window appears with the words Catalog not found.
Do you want to create it? click on Yes.
- c. A graphics window will appear.
- d. Click on File:Print from the graphics window.
- e. 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).
- f. At this point, if you were really printing a graph, you
would click OK, but for the purposes of this
tutorial, just click Cancel
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.
- Step 6: 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 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
An Introduction to SAS/INSIGHT.
- 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.
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.
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 statlab. 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/ucb/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.
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.
You are now ready to begin the SAS tutorial.
Introduction to SAS/EIS, which you'll use to run SAS macros (programs) for
labs and specialized applications.
Introduction to SAS/INSIGHT, a graphically-oriented data analysis system
An overview of the Statistics Multimedia Computer Classroom. (for new users)
An overview of the Unix operating system (for new users).
Joe Petruccelli < jdp@wpi.edu>
Last modified: Fri Jul 27 15:09:17 EDT 2001