|SAS Companion for the OS/2 Environment|
|Using the SAS Text Editor Windows|
The SAS text editor windows (including Program Editor and NOTEPAD) work similarly
to other OS/2 editors. Thus, you can edit your SAS code without learning
how to use a new text editor.
If you are familiar with the SAS Program Editor window under other operating environments such as OS/390 (formerly MVS), notice that under OS/2 line numbers are turned off by default. You can issue the NUMBERS ON command from the command bar to display line numbers in the Program Editor window.
You can also control line numbers by using the Editor Options dialog box when the Program Editor or NOTEPAD is the active window. To open the Editor Options dialog box:
The cursor movement keys (arrow keys, PgUp, PgDn, and so on) function the same way in SAS text windows as they do in other OS/2 applications.
Pressing the CTRL key with the left arrow key (word left) or right arrow key (word right) causes the cursor to move one word at a time. When you advance 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 move to the
beginning of the current line unless the command line is active. 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 line. You can toggle the command line on and
off by using the COMMAND command or by selecting Command line in the Preferences dialog box General
Many text editors retain tab characters, while others expand tabs into space
characters. The SAS Program Editor window expands tabs into space characters.
Pressing the TAB key inserts spaces and moves any text to the right of the
Conceptually, line breaks are at the end of the line rather than at the beginning.
Pressing ENTER creates a line break. To delete a line break, press the Backspace
key at the beginning of a line or press the Delete key at the end of the line.
You can use the mouse or the Shift key in combination with the cursor movement keys to select text. The marking of an area of text continues until you release the mouse button or release the Shift key. To select all of the text in the active window, select Select All from the Edit menu. The following are several advanced text selection methods:
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.
The Delete key deletes the currently selected text; otherwise, it deletes the character to the right of the cursor. To delete from the cursor to the end of the current line, press ALT+DELETE. To delete from the cursor to the end of the current word, press CTRL+DELETE. To delete from the cursor to the start of the current word, press CTRL + BACKSPACE.
You can also use the Edit
menu to delete text. To delete all text in the window, select Clear All. To delete only selected text, select Clear. To delete selected text and
copy that text to the OS/2
clipboard, select Cut.
You can drag and drop selected text between the following locations:.
|Drag text from||And drop it to|
|any SAS text window||another SAS window that supports text editing (such as Program Editor)|
|any SAS text window||another OS/2 application that supports dragging and dropping of text|
|an OS/2 application that supports text drag and drop||any SAS window that supports editing|
|OS/2 Drives View (text file item)||any SAS window that supports editing|
To drag and drop text from one window to another:
Here is a summary of drag-and-drop actions that are available for the possible target windows in SAS:
|text||SAS text editor||move|
|text from Log, Output||Program Editor, SAS text editor||copy|
|file||Other SAS text editor windows||not applicable|
The actions that occur when you drag text out of a SAS window into another OS/2 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 that you press while you drag and drop. To copy
from one window to another (instead of moving it), press and hold the CTRL
key before and during the drag-and-drop action. When you release the mouse
button to drop the text, release the CTRL key as well.
When you copy text out of a SAS window to the clipboard and paste it into
the window of another application, the text retains all of the format information
that it had in SAS (except for color) if the target window accepts RTF formatting.
For example, the OS/2 System Editor does not preserve formatting, but the
OS/2 Enhanced Editor and many other word processors do. The same is true when
you drag text out of a SAS window and drop it in another application window.
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 that 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
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 about the Autosave feature, see
Edit Preferences and WAUTOSAVE.
The following features of the SAS text editor window are different from the standard features of other editors that are commonly used in the OS/2 operating environment:
|Using the Clipboard|
The OS/2 clipboard enables you to exchange text and graphics between applications. You can also submit SAS code that is stored on the clipboard. The clipboard uses operating environment memory as an intermediate storage buffer for exchanging text and graphics. With the clipboard, you can move text between
The SAS System under OS/2 communicates with the clipboard by 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.
You can use the clipboard only if both the source and
destination applications provide support for the clipboard facility and for
the format that you are using. Note that whereas some operating environments
allow multiple paste buffers, the SAS System under OS/2 uses the OS/2 clipboard,
which is a single buffer.
For windows that contain text, such as the Program Editor, NOTEPAD, Log, Output, and KEYS windows, you can hold down either the left mouse button or ALT + the left mouse button and drag the mouse to mark the area that you want to cut or copy. Holding down the left mouse button when you are selecting multiple lines selects whole lines of text. Holding down ALT + the left mouse button lets you select a rectangular block or column of text. The text area is immediately marked in reverse video while you are dragging the mouse. To extend the selection of text area, use SHIFT + left mouse button. Release the mouse button when you have included all the text you want to copy.
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:
The text from the clipboard is pasted to the area that
you indicate. If there is already an area of selected text within the target
window, the selected text is replaced with contents of the clipboard. You
can paste text only into SAS windows that accept text input, such as the Program
Editor or the NOTEPAD.
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 that you are marking is in bitmap format. You cannot scroll in these windows while you are marking text. After you finish marking an area, you can copy it to the clipboard. If the window that you are working in has no Edit pop-up menu, you can use the following keys to perform the copy and paste functions:
|CTRL+INS||copies the selection to the clipboard.|
|SHIFT + INS||pastes the contents of the clipboard.|
Both the SAS/QC ISHIKAWA procedure and the Graphics Editor support the storing
of metafile graphics format as well as bitmap formats on the clipboard. In
the Graphics Editor, the area that you mark is enclosed in a box, and you
cannot scroll as you mark. Use the GSTORE command to store the currently marked
area (the entire screen when used with the ISHIKAWA procedure) on the OS/2
clipboard in device-dependent bitmap (BMP) graphical data formats. You can
also select Copy from the Edit
menu to store the marked area on the clipboard.
You can paste bitmaps into the Graphics Editor
Editor to import graphics. For more information, see Importing Graphics from Other Applications.
The SAS System under OS/2 enables you to use the OS/2 clipboard to submit SAS code. This feature can be used to copy or cut SAS code from another application, such as the OS/2 Enhanced Editor or another text editor, and submit it to the SAS System for execution. This is also convenient for submitting the sample programs that are available in the SAS System Help.
To submit SAS code stored on the clipboard, select Submit Clipboard from the Run menu with the Program Editor window active. Alternatively, you can issue the GSUBMIT command from the command bar as follows:
The GSUBMIT command can be used to submit SAS code that is stored on the clipboard even if the Program Editor window is not the active window (or if it is closed). If you use the GSUBMIT command often, you may want to define an icon for it in the toolbar, 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|
Both SAS NOTEPAD and SAS/AF allow you to 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 and 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. Color names are not case-sensitive.
|ESC+0||Turns off all highlighting attributes|
|ESC+2||Turns on the underline attribute|
|ESC+3||Turns on the reverse-video attribute|
If you want to create alternate ASCII characters such as foreign language characters, you can use the ALT key in combination with the ASCII character code. Use the numeric keypad with NumLock on to enter the character code. For a list of ASCII character codes and instructions about how to use the ALT key sequences, see your OS/2 documentation.
|Issuing SAS Commands|
Many commands are already assigned to menu items for the windows in which
they apply. For example, selecting Submit from
the Run menu for the Program Editor window has
the same effect as typing submit at the Program
Editor command line. The items in the menu bar and pop-up window vary depending
on the 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 action
places a command line in each SAS window. You can then type commands on the
command line in the window in which the commands apply. (For example, the
INCLUDE command is valid in the Program Editor window, but not in the Log
The command bar and the command box offer a central location from which you can submit any SAS command, as long as the command is valid for the active window. If you enter a command that is not valid for the active window, SAS issues an error message.
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 the F11 key. 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 used 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 that you are typing.
You can select your preferences for the command bar by using the Customize Tools dialog box (described in Setting General Toolbar Preferences). To open the Customize Tool dialog box, issue the TOOLEDIT command (described in TOOLEDIT) or select
The toolbar provides a convenient way to issue commands that you use often. To issue a command by using the toolbar, simply click on the icon that represents the command that you need. To learn which tools perform what commands, position the mouse pointer over a tool briefly to display the screen tip for that tool.
When you start the SAS System, the toolbar displays at the top of the main SAS windows. You can detach the toolbar and use it in a separate window by
You can dock the toolbar again by
You can add or change the tools that are defined in the toolbar. For more information, see Customizing the Toolbar.
|Changing the SAS Current Folder|
The current folder is the operating environment folder in which many SAS commands
and actions are valid. The path to 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 that is 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 Working directory field in the Properties Program page for the
SAS program or by specifying the SASINITIALFOLDER system option during SAS
invocation. For more information on the SASINITIALFOLDER, 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 Change Folder Dialog Box) to select a new working folder.
Change Folder Dialog Box
If you organize your files so
that each project has
its own folder, then the Change Folder dialog box allows you to quickly switch
between projects. As you select different projects, the dialog box retains
the directories that you select in the Folder list
You can change the working drive and folder by submitting the change directory (CD or CHDIR) command with the X statement in SAS. The SAS System intercepts the change directory command and then changes drive commands and changes its working folder.
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 and enclosed in single quotes) such as the following:
Top of Page
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.