Search:

How to Use Linux SAS from Mac OS X

If you have questions about accessing the Linux SAS server, please e-mail kathy@iastate.edu or stop by the Statistical Computing Section in Snedecor 117.

The following information applies only to Mac OS X 10.3 (Panther) and Mac OS X 10.4 (Tiger).
Although this information may also work on Mac OS X 10.2 (Jaguar) too, no testing has been done to verify this.

Table of Contents
Availability of SAS
The Linux SAS Server
Running Linux SAS in Full Screen Mode
Running Linux SAS in Batch Mode

Availability of SAS

SAS is publicly available to Iowa State staff, faculty and students on two platforms: Windows and Linux. Currently, both platforms are running version 9.1. SAS for Linux runs on a dual CPU Intel computer available to all Iowa State students, faculty, and staff with valid Iowa State Net-Id's via SSH.
 

The Linux SAS Server

As of January, 2005, Linux SAS has replaced our previous version of Vincent SAS. Linux SAS can be accessed in 2 modes: full screen or batch mode.
 

Running Linux SAS in Full Screen Mode

Linux SAS can be displayed in full screen mode by using the Mac OS X X11 client. If you did not install X11 as part of installing Mac OS X, you need to install it before using Linux SAS in full screen mode.

To install X11:

Mac OS X 10.4
  1. Insert your Mac OS X 10.4 Install DVD.
  2. Double-click the "Optional Installs" package installer.
  3. Click "Continue" on the 'Welcome to the Optional Installs Installer' window.
  4. Click "Continue" on the 'Softare License Agreement' window.
  5. On the 'Select a Destination' window, select a destination volume, then click "Continue".
  6. Expand the "Applications" section by clicking on the disclosure triangle to the left of the "Applications" section name.
  7. Check the "X11" checkbox, then click "Upgrade".
  8. Type in your local Administrator's Name and Password, then click "Continue".
  9. Click "Close" when the software has been successfully installed.

Mac OS X 10.3
  1. Insert disc 3 of your Mac OS X 10.3 Install CD set.
  2. Double-click on the X11User.pkg file located in the "Packages" folder.
  3. Click "Continue" on the 'Install X11' window that says:
    This Installer package needs to run a
    program to determine if it can be
    installed. Do you want to continue?
  4. Click "Continue" on the 'Welcome to the X11 Installer' window.
  5. On the 'Select a Destination' window, select a destination volume, then click "Continue".
  6. Click "Upgrade" on the 'Easy Install on "Mac OS X 10.3"' window.
  7. Type in your local Administrator's Name and Password, then click "Continue".
  8. Click "Close" when the software has been successfully installed.

The Mac OS X X11 application defaults to displaying all X11 windows on your desktop along with your other Mac OS X application windows. If you wish to display your X11 windows in a separate "screen", choose X11->Preferences and under "Output" check the "Full screen mode" checkbox. Then use the Command-Option-A keystroke to enter and leave X11 full screen mode.

To run Linux SAS in full screen mode on your Mac OS X system, first launch the X11 application (in /Applications/Utilities). When the "xterm" window appears, execute this command to connect to the Linux SAS Server:

ssh -X sas.iastate.edu

Note that -X must be specified to enable X11 forwarding over SSH (i.e. SSH Tunneling).

The first time you ssh to the Linux SAS Server, you will be asked if you want to continue:

The authenticity of host 'sas.iastate.edu (129.186.142.3)' [...]
RSA key fingerprint is [...]
Are you sure you want to continue connecting (yes/no)?

Answer yes. You will not be asked this question again on subsequent ssh connections.

You will then be asked to type in your Iowa State Net-Id password (assuming that you are logged into your Mac OS X system using the same login name as your Net-Id). If you are using a different Mac OS X login name, use this ssh command instead:

ssh -X -l net-id sas.iastate.edu

where 'net-id' is your Iowa State Net-Id.

Then, after logging into the Linux SAS server, to run SAS, execute this command:

sas &

This will bring up the SAS windows. You can enter your program code in the Program Editor window and submit the code. Your errors/comments will appear in the Log Window and Results in the Output Window.

To print results from the output window, click on File->Print and select your printer of choice. Note that the Durham and Snedecor printers are UBill printers.

If you select to print to your "Default Vincent Printer" it will print to the printer defined in one of your startup files. To find out your default printer, type "env | grep PRINTER". To change your default printer, execute the following in the xterm command window:

setenv PRINTER "new-printer"

Running Linux SAS in Batch Mode

To access the Linux SAS Server in batch mode, launch the Terminal application (in /Applications/Utilities). When the terminal window appears, execute this command to connect to the Linux SAS Server:

ssh sas.iastate.edu

The first time you ssh to the Linux SAS Server, you will be asked if you want to continue:

The authenticity of host 'sas.iastate.edu (129.186.142.3)' [...]
RSA key fingerprint is [...]
Are you sure you want to continue connecting (yes/no)?

Answer yes. You will not be asked this question again on subsequent ssh connections.

You will then be asked to type in your Iowa State Net-Id password (assuming that you are logged into your Mac OS X system using the same login name as your Net-Id). If you are using a different login name, use this ssh command instead:

ssh -l net-id sas.iastate.edu

where 'net-id' is your Iowa State Net-Id.

Using an editor (such as 'joe', 'emacs', or 'vi'), create your SAS program. For example,

joe myprogram.sas

Then enter the following command to run the program in batch mode:

sas myprogram.sas

This will create the following files that can be viewed with your editor or with a pager program (such as 'more' or 'less'):

myprogram.log
contains comments and errors

myprogram.lst
contains the output

If there are errors, use your editor to fix the myprogram.sas file and rerun the program.

To print, use the "lpr" command to print your output:

lpr -Pprinter myprogram.lst

where 'printer' is the printer you want to print to. Note that the Durham and Snedecor printers are UBill printers.
 

Last updated August 31, 2009