Chapter Contents


SAS Companion for the Microsoft Windows Environment

Submitting SAS Code

The SAS System under Windows provides several methods for you to submit your SAS programs for processing. SAS supports a variety of work strategies, whether you run SAS interactively or in batch, and in conjunction with other Windows programs or as a stand-alone.

Submitting Code from the Program Editor or Enhanced Editor

To submit SAS code that you have typed into the Program Editor window, you issue the SUBMIT command. SAS provides a few ways to issue SUBMIT:

Submitting Code from the SAS Text Editor

SAS allows you to submit SAS code that you have typed into the SAS text editor (NOTEPAD). The SAS text editor may be invoked using the Tools menu and selecting Text Editor. SAS provides several ways to submit the code in the text editor:

Submitting Code from the Clipboard

You can submit SAS code that you copied from another Windows application (such as an editor or word processor) or from SAS System Help. When you copy text from another Windows application, that text is stored in the Windows clipboard.

From the Run pull-down menu in the Program Editor window, select Submit clipboard. The code is submitted from the clipboard directly to the SAS System (without appearing in the Program Editor window), and notes and results are sent to the SAS log and Output window, respectively. You can still issue the RECALL command (or press F4) to recall the submitted program into the Program Editor window.

You can also use the GSUBMIT command to submit SAS code that is stored in the clipboard. For more information, see GSUBMIT.

Submitting Code by Dragging and Dropping

You can drag SAS programs from other Windows applications onto an open SAS session and submit them. You can also drag files that contain SAS code and drop them on an open SAS session to submit them.

Dragging Text from Other Windows

If you drag text from another Windows application or SAS window to the Program Editor window, that text is moved or copied to the window by default. It is not submitted until you press F8 or issue the SUBMIT command. However, you can override this default action by dragging the text using the right mouse button (if the application supports non-default dragging and dropping). When you drop the selection on the Program Editor window, SAS pops up a menu to let you choose between copying the code and submitting it.

Dragging Files in an Interactive Session

Using the My Favorite Folders window, you can access files that exist outside the SAS environment. Files that contain SAS code can be dragged and dropped into your interactive SAS session for execution. The My Favorite Folders window can be accessed using the View menu.

If you drag a file that contains SAS code and drop it on the Program Editor window or the Enhanced Editor window, that code is included in the window (but not submitted). If you drop the file on the Log or Output window or on an minimized SAS session, the code is automatically submitted.

Note:   When you minimize a SAS session, its icon appears on the Windows task bar. You cannot drag and drop a file onto the task bar. Instead, you can drag the file to the SAS icon on the task bar and hold it there, without releasing the mouse button. After about one second, the SAS window will restore to normal size, after which you can drop the file on the open SAS session.  [cautionend]

Dragging and dropping the file C:\MYPROG.SAS onto a window (other than the Program Editor or Enhanced Editor windows) of an open SAS session is the same as issuing this command:

gsubmit "%include 'c:\'";

You can submit more than one file at once by selecting a group of files containing SAS programs and then dragging and dropping them onto the open SAS session. The order in which the programs are run when they are submitted as a group is determined by Windows. Therefore, if order is important, you should drag and drop each program file separately.

Note:   If the SAS System is busy when you drop a SAS program icon, the dropped file is ignored. The only indication that the dropped file was ignored is a warning beep.  [cautionend]

Dragging Files to Start a Batch Session

If you drag a file containing SAS code and drop it on a SAS System program icon, the SAS System starts in batch mode and submits the code for processing.

Submitting Code Stored in Registered SAS File Types

During installation, the SAS Setup procedure registers certain file types with Windows to invoke specified actions when you double-click on those types of objects. For example, files with a file extension of .SS7 or .SAS are registered as SAS programs. These registered file types are displayed in Windows with a special icon, as shown here:


When you double-click on a file with this extension (or with this icon) the SAS System is invoked and the contents of the file are included (using the INCLUDE command) in the Program Editor window. The SAS code contained in the file is not processed until you submit it (for example, by pressing F8 or clicking the Submit tool). If you already have a SAS session running, double-clicking on a file begins a second SAS session; it does not use the already-existing session.

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.