NC STATE University
SAS Consulting, Department of Statistics 

Tips for SAS Version 8.2 Users on UNITY

In August 2001, SAS Version 8.2 became the default version of SAS. Older versions are available and instructions for accessing them will be provided below. The color-coded editor is available on UNIX for the first time with this version.

Additional Sources of Information

To Start SAS 8.2

If you use the ampersand, you will be able to execute UNIX commands from the prompt in your XTERM window. If you do not use the ampersand, you can get a prompt in your XTERM window by typing ctrl+z and then bg.

Printing from UNIX

Print Quota: There is a per page charge for printing on the Wolfcopy printers. To check your print quota use the commmand lpquota. You can add print quota at the Talley Student Center or University Graphics.

To print from within SAS, you need to create a new printer definition. If you do not create a printer definition, when you select File --> Print the results will be sent to a postscript file named sasprt.ps.

With your user defined printer, you will be able to print from the program, log, output and graph windows. SAS uses an icon that looks like a "human" in the Printer Setup window to identify printers created by a user.

You can also define a print previewer. If you define a print previewer before defining a printer, the print previewer can be used in the printer definition. SAS uses an icon that looks like "three humans" in the Printer Setup window to distinguish print previewers created by a user.

Define a Print Previewer using the new Previewer Wizard

Add the Previewer to an Existing Printer Definition:

This method can be used to add a previewer to an existing printer definition.

Create a New Printer Definition.

Choose a Font for Printing

To print your output without truncation, you must match the output line and page size with the line and page size in the printer definition. This is a two step process.

Step 1: Choose a Printer Font Face and Size

This is done in the printer definition as follows:

Step 2: Set Your Output Line and Page Size.

Use an options statement in your program or your autoexec.sas file to set output linesize and pagesize to match the printer settings. It is best to choose settings slightly smaller than the printer settings. If the output settings are larger than the printer settings, each line of output will be truncated when printed.

For example, if your printer linesize=107 and pagesize=100 you could use the following:
    options ls=105 ps=98 formdlim='_' ;

Additional Printing Options:

  1. Sending graphs directly to the printer, rather than printing from the graph window, will usually improve their appearance. Instructions and a sample program with instructions can be found at: graphout.sas
  2. You can save your output or program to a file and use the UNIX command, lpr , to print.
  3. You can copy your saved file to a disk with the Unix command, mcopy.
    More instructions are available below in "Copying Files To and From Disk".
  4. You can mail your results using: File --> Send Mail.

Frequently Modified Editing Options

Turn AUTOSPLIT On

AUTOSPLIT is off by default. With the AUTOSPLIT option on, text is moved to the next line when the return key is pressed. Two methods for turning AUTOSPLIT ON are provided.

Method 1:

Method2:
Add this statement to your autoexec.sas file.
dm 'autosplit on';

SET AUTOSCROLL

Details from SAS OnLine Guide: The AUTOSCROLL command controls the scrolling of lines as they are written to the Log and Output windows. The default value for AUTOSCROLL in the Log and Output windows is 1. Processing is slower when AUTOSCROLL displays one line at a time. To expedite processing, you can specify a greater AUTOSCROLL value in your autoexec.sas file. Specifying a value of 0 optimizes processing and results in the fastest scrolling (similar to jump scrolling in xterm windows).

Below are three methods that can be used to set the AUTOSCROLL option.

Method 1:
In the Output and Log Toolbox window, enter and submit: autoscoll 0;

Method 2:
In the toolbox of any window, enter and submit: log; autoscroll 0; out; autoscroll 0;

Method 3:
Add this line to your autoexec.sas file.
    dm "log;autoscroll 0;out;autoscroll 0;"

Turn Auto Store Selection Off

With the Auto Store Option turned on, highlighted text is automatically stored in the paste buffer and the text does not stay highlighted. This is the default setting.

To turn Automatically Store Selection off:

Program Your Keys

Keys can be programmed in the Keys window to execute any command line commands. The keys window can be opened by selecting: Tools --> Options --> Keys

CTRL+E was programmed in previous versions of SAS to clear the log and output windows, submit the program and go to the top of the log window. You can program CTRL+E by entering the following on the CTR+E line of the Keys window.

    out;clear;log;clear;pgm;sub;log;top;

Change the Current Working Directory

To change the current working directory select: Tools-->Options-->Change Directory.

Interrupt or Terminate a SAS Session

There are interrupt and terminate buttons in the Session Management window. This window may be an icon at the bottom of your screen. It usually has an X or a lighteningbolt symbol.

Copy Files to and From a Disk

To copy a file to disk
    mcopy -t your-unix-file a:your-pc-file

To copy a file from disk
    mcopy -t a:your-pc-file your-unix-file

In an XTERM window use the dos2unix command to convert a PC file to a UNIX file. This is necessary if you want to use a file on the UNITY system that you created on a PC. This is because the two platforms use different end-of-line and end-of-file markers.
   dos2unix old-file-name new-file-name

Using Older Versions of SAS

To use older versions of SAS you can add them using add sas612 or add sas81. These older versions will be removed sometime in the future. Once you have used one of these add commands you need to use add sas82 to start SAS version 8.2.

Storing Your User Preferences

When you start SAS, the directory sasuser.800 is created, if it doesn't already exist. When you modify your SAS preferences, they are stored in a file in this directory. Occassionally, this directory will become corrupt and SAS behave badly. You may want to backup sasuser.800 after you setup your preferences.

The UNIX command to copy this directory is:
    cp -r sasuser.800 sasuser.800.bak

The UNIX command to move this directory is:
   mv sasuser.800 sasuser.800.old

You can restore your backup with the UNIX command:
    mv sasuser.800.bak sasuser.800


[an error occurred while processing this directive]
Maintained by:Sandy Donaghy and Joy Smith
Last Modified: Thursday, 13-Dec-2001 15:11:00 EST
Filename: /working_groups/sas/faq/v82tips.html