SAS tips and tricks

Usability_tips
Advanced tips

Usability tips

Enable printing from SAS
  1. Select File > Print Setup. Push Next.
  2. Under Name write XPP. Leave description empty. Push next.
  3. In the Printer model selection list, leave as the default. Push next.
  4. Set the following options in the next window and push next.
    Device Type: Pipe
    Destination: /apps/dcc/bin/xpp
    Host options: <blank>
  5. Finished.

When you print from any window, a dialog box will show where you can select the printer of your choice.

Remote access

Thinlinc can let you access SAS (and other things) over the internet, so you don’t have to install several GB SAS-program etc. Convenient, unless you use the programs very much. See G-bar wiki on how to use Thinlinc.

Allow linebreaks in Program Editor

To have line-breaks in the SAS-editor you first mark the editor, open the Toolbox and write in the white space:
autosplit

To make this permanent write in the Toolbox:
wsave

Avoid clearing Program Editor on Submit
  1. Select the Program Editor window
  2. Goto Tools > Options
  3. Select the Editing tab
  4. Remove check mark from Clear text on submit
  5. Push OK
Save window positions

To save the position of the windows:
put them where you want them
mark them one at a time and write "wsave" in the toolbox for each one

Shortcut keys

Push F2 to see a list of shortcut keys and have the possibility of customizing them. (or, write keys in the toolbox)

More advanced tips

Running SAS as a background job

The following assumes you are in your home directory.

  1. Use your favorite editor (must be able to save as ASCII).
  2.  Enter the following 4 SAS-program lines:

    * Hurra!! My first SAS-programme; * comment;
    * empty line;
    proc print data=stat2.sundhed; * print data;
    run;

  3. Save the file as eg. myown.sas (NB: as ASCII, or plain text)
  4. In a terminal window run the program by:

    sas myown
  5. In the directory there should now exist 2 new files, a myown.log and a myown.lst. You can examine the files by writing:

    more myown.log
    and
    more myown.lst

    or look at them in your favorite editor or whatever you prefer.
SAS via SSH

A command which lets you open graphical programs (SAS, Matlab) over ssh (probably x11 must be installed)
ssh -Y -C s05xxxx@thinlink.gbar.dtu.dk

Then sas can be run by:
sas &

& means that sas runs as a background job and frees the terminal.