Getting started with SAS on Phoenix

Michael Friendly

Accessing Phoenix

You normally access Phoenix using the Telnet program (or other terminal emulator), connecting to phoenix.yorku.ca. Note that it is possible (and often convenient) to start up several Telnet windows to your phoenix account, giving you the means to view a file on one screen, while executing commands on another.

Setting up your account

Psychology courses have a set of directories on phoenix for shared data and SAS files. You can skip this step if you have no need for these files.

To make these directories accessible to SAS requires that SAS be started with a special autoexec.sas. The steps below will set up your phoenix account so that SAS always starts with these directories defined.

In the future, the setenv SAS612_OPTIONS command will be executed automatically whenever you login or open a new window.

Alternatively, you can accomplish the same thing by simply copying the autoexec.sas file to your home directory.

% cp /courses/as/psyc/autoexec.sas ~
(but if I change it, you'll still have the old copy.)

Running SAS on Phoenix

You can run SAS in two different ways:
  1. create a SAS program with an editor; run SAS in 'batch' mode.
  2. interactive mode, typing commands to the SAS Program Manager More detailed information is contained in the CCIS Help document, SAS on Phoenix

    Running SAS in 'batch' mode

    Running SAS interactively

    SAS runs interactively with the Program Manager windows when you issue the SAS command with no input file.

    VT100 terminal

    If you are using a VT100-type terminal emulator, use the command-line option -fsdevice ascii.vt100
    % sas -fsdevice ascii.vt100
    
    The display should look like this:
    +LOG---------------------------------------------------------------------------+
    |Command ===>                                                                  |
    |                                                                              |
    |NOTE: AUTOEXEC processing beginning; file is                                  |
    |      /courses/as/psyc/autoexec.sas.                                          |
    |                                                                              |
    |NOTE: SAS initialization used:                                                |
    |      real time           8.34 seconds                                        |
    |      cpu time            0.24 seconds                                        |
    |                                                                              |
    |NOTE: AUTOEXEC processing completed.                                          |
    +------------------------------------------------------------------------------+
    +PROGRAM EDITOR----------------------------------------------------------------+
    |Command ===>                                                                  |
    |                                                                              |
    |00001                                                                         |
    |00002                                                                         |
    |00003                                                                         |
    |00004                                                                         |
    |00005                                                                         |
    |00006                                                                         |
    +------------------------------------------------------------------------------+
    The default display does not show menus. To use the SAS menus, type the command pmenu on on the SAS Program Manager command line (after the ===>).

    X-Windows

    CCS: How to run SAS on phoenix describes X-Windows use.

    Printing your output

    Local printing

    If you're working from home, probably the most convenient way is to use your FTP program to transfer the .lst and .log files to your own computer and print from there. That's what I do most of the time.

    Remote printing

    Use the lpr command to print a file from phoenix. Your printed output is routed to a printer determined by the PRINTER environment variable, or by the -P option on the lpr command. (But note that the printers in BSB are now on the charged print-release system, and disappear from the print queue after 2 hours.)

    Some printers are:

    To select the bsb_159 as the default printer for your session, and print the .lst and .log files for an assignment, enter the commands:

    % setenv PRINTER bsb_159
    % lpr assign3.log
    % lpr assign3.lst
    
    If you mostly use one printer, you can add the setenv PRINTER to your .cshrc file.

    SAS/GRAPH

    SAS/GRAPH on Unix (without X-windows) cannot display high-res graphics in a terminal window, but it can write graphics files in PostScript, GIF, JPG, and many other graphics formats. After running SAS with a graphics driver (PostScript, for example), a file is created in the current directory which you can download and view (with an appropriate viewer) or print.

    For some people, PostScript graphics are easiest because they can be printed directly on Laserjet 4M or 5Si printers, and can be viewed at home using the free GSView/Ghostscript package for Windows.

    To generate graphics files from SAS, simply include the following lines in your SAS program before the point where any graphics are created:

      %newsas(filename);
      %pscolor;
    or
      %gif;
    
    where filename is the name of your SAS file. The graphic output will then appear in a file named filename.ps in your current working directory. (For GIF output use %gif; instead of %pscolor;.) [If you omit the statement %newsas(filename), the output will appear in a file named grfout.ps.]