Chapter Contents |
Previous |
Next |
SAS Companion for the Microsoft Windows Environment |
The following sections describe how to work within your SAS session. These features include the SAS Text Editor (Program Editor and SAS NOTEPAD), the clipboard, special characters, SAS commands, and the SAS working folder. For information about using the Enhanced Editor, see Using the Enhanced Editor.
Using the SAS Text Editor Windows |
You can also control line numbers using the Editor Options dialog box when the Program Editor or NOTEPAD is the active window. To open the Editor Options dialog box:
Tools | Options | Editor |
Pressing the CTRL key with the left arrow (word left) or right arrow (word right) causes the cursor to move one word at a time. When advancing through text, the word-left and word-right commands stop at the end of the text on a line and at the beginning of the first word on a new line. You can move to the top of a file by pressing CTRL+PgUp or to the bottom of a file by pressing CTRL+PgDn.
Pressing the Home key causes the cursor to go to the
beginning of the current line unless the command line (not the command bar)
is active in the active window. Pressing the Home key when the command line
is active causes the cursor to toggle between the current cursor position
in the text and the command line. The F11 key moves the cursor to the command
bar. You can toggle the command line on and off using the COMMAND command
or by selecting Command line in the Preferences
dialog box General page.
If characters are selected and you start typing text, the marked area is replaced with the new text. This occurs even if you have moved the cursor away from the marked area. For information about marking and copying text with a mouse, see Using the Clipboard.
To unmark text, click the left mouse button in the window.
Alternatively, you can unmark text by selecting Deselect
from the Edit menu or you can press the ESC key.
You can also unmark text using the up, down, left, and right arrow navigation
keys if Enable unmarking with navigation keys is
selected in the Preferences dialog box Edit page.
Entering the WNAVKEYUNMARK ON in the command bar also enables unmarking with
the arrow navigational keys.
You can also use the Edit menu to delete text. To delete
all text in the window, click Clear All. To delete
only selected text, click Clear. To delete selected
text and copy that text to the Windows clipboard, click Cut.
Summary of Text Drag and Drop Possibilities lists the places from which you can drag text and to which you can drop the selected text.
Drag text from | and drop it to |
---|---|
any SAS text window | another SAS window that supports text editing (such as the Program Editor window) |
any SAS text window | another Windows application that supports text drag and drop |
a Windows application that supports text drag and drop | any SAS window that supports editing |
Windows Explorer (text file item) | any SAS window that supports editing |
To drag and drop text from one window to another:
Note: Instead of arranging your windows so that the
target window is visible, the target window will become the active window
when you drag the selected text to the target window's button on the window
bar.
Summary of Drag-and-Drop Actions is a summary of drag-and-drop actions available for the possible target windows in SAS.
Data | Target | Default Action |
Nondefault Actions |
---|---|---|---|
text | SAS text editor | move | move, copy, cancel |
text | PROGRAM EDITOR |
copy | copy, submit, cancel |
file | SAS text editor | not valid | not valid |
file | PROGRAM EDITOR |
move | copy, submit, cancel |
file | LOG, OUTPUT | submit | submit, cancel |
The actions that occur when you drag text out of a SAS window into another Windows application depend on the target application. In most cases, dragging and dropping text between SAS and other applications actually moves the text from one window to another (that is, the text is cut from one window and placed in the other).
You can change that behavior by applying a drag-modifier--a key you press while you drag and drop. To copy text
from one
window to another (instead of moving it), press and hold the CTRL key before
and during the drag and drop. When you release the mouse button to drop the
text, release the CTRL key as well.
Once you have selected the text and drag it to the SAS text editor window, pause near the border of the SAS text editor window. The window scrolls in the direction of that border. For example, to cause the target window to scroll down, drag the mouse pointer just above the bottom border of the window and pause.
Drag scrolling only happens when you pause near the
drop area border; it does not occur if you drag quickly past the border.
If the display font is Sasfont, any text that you copy
out of SAS is formatted with the SAS Monospace TrueType font. If your text
has other highlighting attributes, such as underline, those attributes are
also transferred to the target window in the other application (provided the
target window supports rich text format (RTF)).
To be sure that you do not lose any of your work in the Program Editor, the SAS System can automatically save your files at an interval you specify. The interval can range from 0 (Autosave off) to 480 minutes. The default interval is 10 minutes. To enable or disable autosave and set the interval, select
Tools | Options | Preferences... | Edit page |
You can also use the WAUTOSAVE command to enable, disable, and set the interval. WAUTOSAVE INTERVAL=minutes will turn on autosave using minutes as the interval.
For more information on the Autosave feature, see
Edit Preferences and WAUTOSAVE.
Navigating with Microsoft IntelliMouse |
The SAS System provides support for the Microsoft IntelliMouse. The IntelliMouse is a modified mouse that includes a rotation wheel (wheel control) that enables new forms of navigation. The IntelliMouse works within SAS System windows that use a vertical scrollbar for scrolling the window contents.
With the IntelliMouse, you can use the mouse to scroll instead of interacting with the navigational controls in the SAS System windows. To scroll with the IntelliMouse, you rotate the wheel control forward or backward, which is equivalent to pressing the up arrow or down arrow on the scrollbar.
The IntelliMouse also supports AutoScroll. To initiate AutoScroll, click the mouse wheel and then move the mouse away from the origination point. The contents of the window will start to scroll in the direction you move the mouse. The farther away you move the mouse from the origination point, the faster the contents will scroll. Pressing a key, clicking a mouse button, or rotating the mouse wheel will terminate AutoScroll mode.
You can modify IntelliMouse settings through the Windows Control Panel mouse settings. For more information about IntelliMouse, see the Microsoft documentation.
Using the Clipboard |
The SAS System under Windows communicates with the clipboard using these formats:
These formats enable you to copy text and SAS bitmapped information (for example, from a graphic) to another application. You can also use the Print Screen and ALT+Print Screen keys to copy information from your SAS session to the clipboard. Pressing Print Screen places the entire display in bitmap form on the clipboard. Pressing ALT+Print Screen places just the SAS session (including any menus and scroll bars) or the active dialog box (if any) on the clipboard.
You can use the clipboard only if both the source and
destination applications provide support for the clipboard facility and for
the format you are using. Note that whereas some operating environments allow
multiple paste buffers, the SAS System under Windows uses the Windows clipboard,
which is a single buffer.
To copy marked text to the clipboard, do one of the following:
To paste text that is stored on the clipboard, position the cursor in a text area in a window and do one of the following:
For windows such as the GRAPH and SAS/ASSIST windows, an area
is marked by a box, not by reverse video. The box indicates that the area
you are marking is in bitmap format. After you finish marking an area, you
can copy it to the clipboard. If the window you are working in has no
Edit
pop-up menu, you can use the following keys combinations to perform
the copy and paste functions:
CTRL+C | copies the selection to the clipboard. |
CTRL+V | pastes the contents of the clipboard. |
Some windows, such as the BUILD: DISPLAY window for FRAME entries in SAS/AF software, let you paste bitmaps into the window. For more information, see Pasting an OLE Object from the Clipboard.
Also, you can paste bitmaps into the
SAS/GRAPH window
to import graphics. For more information, see Importing Graphics from Other Applications.
To submit SAS code stored on the clipboard, select the Run pull-down menu and then select Submit clipboard with the Program Editor window active. Alternatively, you can use the GSUBMIT command from the command line, with the following syntax:
gsubmit buf=default
The GSUBMIT command can be used to submit SAS code stored on the clipboard even if the Program Editor window is not the active window (or is closed). If you use the GSUBMIT command often, you may want to define an icon for it in the tool bar, or assign the GSUBMIT command to a function key. For more information about how to define toolbar buttons, see Customizing the Toolbar.
Creating Text Highlighting and Special Characters |
This section describes special character attributes
and alternate ASCII characters.
The SAS NOTEPAD and SAS/AF applications let you use extended color and highlight attributes for text. To access these attributes, press the ESC key and the appropriate letter or number to turn a color or attribute on or off. With this feature, you can alter the color or attributes of entire lines or individual words or letters. Valid colors and attributes, as well as the keys you use to implement them, are listed in Extended Color Key Sequences and Extended Attribute Key Sequences. You can type the letters for the colors in either uppercase or lowercase.
Key | Color | Key | Color |
---|---|---|---|
ESC+A | gray | ESC+B | blue |
ESC+C | cyan | ESC+G | green |
ESC+K | black | ESC+M | magenta |
ESC+N | brown | ESC+O | orange |
ESC+P | pink | ESC+R | red |
ESC+W | white | ESC+Y | yellow |
Key | Description |
---|---|
ESC+0 | turns off all highlighting attributes. |
ESC+2 | turns on the underline attribute. |
ESC+3 | turns on the reverse-video attribute. |
Issuing SAS Commands |
The following sections describe various ways you
can issue commands
to the SAS System under Windows.
The items in the menu bar and pop-up menu vary depending
on the active window. This ensures that each menu item is valid and appropriate
for the currently active window.
If you want to use the command line to issue commands, select Command
Line from the Preferences dialog box View page. (For more information, see Setting Session Preferences.) This places
a command line in each SAS
window. You can then enter commands at the command line in the window to which
the commands apply. For example, the INCLUDE command applies in the Program
Editor window, but not in the Log window.
By default, SAS displays a command bar at the top of the main SAS window. You can also undock the command bar and use it in a separate window. To undock the command bar:
To dock the command bar again:
To move your cursor to the command bar, press F11. Pressing F11 when you are using the command box docks the command box and places the cursor in the command bar.
The SAS System stores the commands that you enter in the command bar from session to session, and you can easily retrieve previously entered commands by selecting them from the drop-down list. The default number of commands to save is 15, but you can save from zero to 50 commands. SAS can store the commands either in order of the most recently entered or in order of the most frequently used. To store the commands by the most recently used, select Sort commands by most recently used in the Customize Tools Toolbar page. When this option is not selected, the commands are sorted by the most frequently used.
You can also retrieve previously entered commands by starting to type them in the command bar. If Use AutoComplete is selected in the Customized Tools Toolbar page, the SAS System completes the command that best matches the command you are entering.
You can select your preferences for the command bar by using the Customize Tool dialog box (described in Setting General Toolbar Preferences). To open the Customize Tool dialog box, enter the TOOLEDIT command (described in TOOLEDIT) or select
Tools | Customize... |
When you start the SAS System, the toolbar displays at the top of the main SAS windows. You can undock the toolbar and use it in a separate window by
To dock the toolbar again
You can add or change the tools defined in the tool bar and customize the toolbar for an application. For more information, see Customizing the Toolbar.
Changing the SAS Current Folder |
The current folder is the
operating system folder to which many SAS commands and actions apply. The
SAS current folder is displayed in the status line at the bottom of the main
SAS window. By default, the SAS System uses the folder designated by the SASUSER
system option in the SAS configuration file as the current folder when you
begin your SAS session. You can specify a different default current folder
by changing the Start In field on the Properties
page for the SAS program shortcut or by specifying the SASINITIALFOLDER system
option during SAS invocation. For more information on using the SASINITIALFOLDER
system option, see SASINITIALFOLDER.
To change the SAS current folder during your SAS session, double-click on the current folder in the status line. Then use the Change Folder dialog box (shown in The Change Folder Dialog Box) to select a new current folder.
If you organize your
files so that each project has
its own folder, then this Change Folder dialog box lets you quickly switch
between projects. As you select different projects, the dialog box retains
the directories you select in the Folder drop-down
list.
For example, the following statements change the working folder for your SAS session to the MYDATA folder and G:\SALES\JUNE folder, respectively:
x 'cd \mydata'; x 'cd g:\sales\june';
To simply change the working drive, you can submit a change drive command (the drive letter followed by a colon) such as the following:
x 'a:';
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.