Submitting SAS Code


Introduction to Submitting SAS Code

SAS 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 application.

Submitting Code from the Enhanced Editor or Program Editor

To submit SAS code that you have typed into the Enhanced Editor or Program Editor window, you issue the SUBMIT command. SAS provides several ways to do this:

  • Press F8 when the editor window is active.

  • Click the Submit toolbar button.

  • Enter submit in the command bar.

  • From the Run pull-down menu, select Submit .

You can use the SUBTOP command from either the command line or the Run pull-down menu to submit one or more lines of your SAS code. For more information, see 'SUBTOP Command' on page 350.

Submitting Code from the SAS NOTEPAD Text Editor

SAS allows you to submit SAS code that you have typed into the SAS NOTEPAD text editor. NOTEPAD may be invoked by selecting

Tools Text Editor

when the Enhanced Editor is disabled. SAS provides several ways to submit the code in NOTEPAD:

  • Click the Submit toolbar button.

  • Enter submit in the command bar.

  • From the menu, select

    Run Submit

Submitting Code from the Clipboard

Using the Program Editor, you can submit SAS code that you copied from another Windows application (such as an editor or word processor) or from the SAS Help and Documentation. 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 SAS (without appearing in the Program Editor window). 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 Command' on page 345.

Submitting Code by Dragging and Dropping

Introduction to 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 Enhanced Editor or the Program Editor window, that text is moved 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 nondefault dragging). When you drop the selection on the Enhanced Editor or the Program Editor window, a menu appears and you can choose between moving the code or copying the code. The menu for the Program Editor also enables you to submit the code.

Dragging Files in an Interactive Session

By using the My Favorite Folders window, you can access files that exist outside the SAS environment. Files that contain SAS code can be dragged into your interactive SAS session for execution. Access the My Favorite Folders window by using the View menu.

If you drop a file that contains SAS code on the Enhanced Editor window or the Program 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 a minimized SAS session, the code is automatically submitted.

When you minimize a SAS session, its icon appears on the Windows task bar. You cannot 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 resumes its normal size . Then you can drop the file on the open SAS session.

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

 gsubmit "%include 'c:\myprog.sas'"; 

You can submit more than one file at once by selecting a group of files that contain SAS programs and then 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 drop each program file separately.

If SAS 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.

Dragging Files to Start a Batch Session

If you drag a file that contains SAS code and drop it onto a SAS program icon, SAS 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 those types of objects. For example, files that have a file extension of .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 a file that has this extension (or that has this icon) SAS is invoked and the contents of the file are included in the Enhanced Editor or Program Editor window. The SAS code that is contained in the file is not processed until you submit it (for example, by pressing F8 or by clicking the Submit tool). If you already have a SAS session running, double-clicking a file begins a second SAS session; it does not use the already-existing session.

SAS uses the default configuration file if you start SAS by double-clicking a registered SAS file type, such as .sas or .sas7bpgm.




SAS 9.1 Companion for Windows
SAS 9.1 Companion for Windows (2 Volumes)
ISBN: 1590472004
EAN: 2147483647
Year: 2004
Pages: 187

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net