Launching SAS Files from Windows Explorer

Most SAS files can be opened directly from Windows Explorer (aka the “Computer” icon on your Winstat desktop), either by double-clicking, or by right-clicking and selecting an action from the pop-up context menu. However, SAS has many components, and as a result the context menu has many options. This article will explain what those options mean.

One advantage of launching SAS files in this way rather than starting SAS by itself is that the working directory is automatically set to the location of the file. A possible disadvantage is that if you have written an autoexec.sas file it will not be run (unless you choose Batch Submit).

It's possible to change what SAS does when you double-click on a SAS file, but we don't recommend you do so. It's very complicated, and it's very difficult to undo mistakes!

Launching Program Files

When you double-click on a SAS program file (any file with the extension .sas), it opens in the classic SAS interface (also known as the SAS Display Manager) in the usual Editor window (the Enhanced Editor) using 64-bit SAS.

If you right-click on a SAS program file, you'll get the following context menu:

Context menu for SAS programs

Menu Item Action
Opens the program in the Enhanced Editor (same as double-click)
Runs the program as a batch job after running autoexec.sas. Any output is saved as files.
Open the program as a Program object in SAS Enterprise Guide
Opens the program in the Enhanced Editor using 32-bit SAS
Prints the program to your default printer.
Opens the program in the Program Editor, and runs it. Output appears in regular SAS windows.

Launching Data Files

Double-clicking on a SAS data file (a file with the extension .sas7bdat) opens it in the Display Manager interface in a Viewtable window. However, if the data set has variables that are formatted with user-defined formats, SAS will not be able to find those formats and will refuse to open the data set.

If your data set has user-defined formats, you have two options:

  1. Launch SAS from the Start button, tell SAS where to find the formats using either libname library or options fmtsearch, then open the data set either from the SAS Explorer or the Windows Explorer.
  2. Launch the data set in SAS Enterprise Guide from the context menu.  Enterprise Guide will strip the user-defined formats out of your data set.

If you right-click on a SAS data file, you'll get the following context menu:

Context menu for a SAS data set

 

Menu item

Action
Opens the data set in a Viewtable—fails if it has user-defined formats (same as double-click)
Open the data set as a Data object—ignores user-defined formats
Opens the data set in a Viewtable—fails if there are user-defined formats. Uses 32-bit SAS.
Prints the entire data set to your default printer—fails if there are user-defined formats

Launching Output Files

SAS “list” output files (files with the extension .lst) are text files that can be opened with any suitable text editor or word processor.  This is the default form of output for SAS batch submissions, and is the form of output that the SAS Display Manager produces the most quickly (although the slower html output is now the default).  A downside of these list output files is that they are produced with SAS fonts, and often look awful in other programs.  However, they remain a staple of “draft” quality output. To view these files using SAS fonts, it is convenient to open them in the SAS Display Manager.

Double-clicking on a SAS output file opens it in a Preview window in the Display Manager.

If you right-click on a SAS output file, you'll get the following context menu:

Context menu for SAS output files

Menu item Action
Opens the file in Preview window, uses SAS fonts (same as double-click)
Open the file as a Text object, does NOT use SAS fonts
Opens the file in Preview window, uses SAS fonts. Uses 32-bt SAS
Prints the output file from SAS to your default printer

 

Last Revised: 11/20/2012