Running and Debugging
Executing a SAS Program
You can run your SAS program (sans JCL of course) from within Multi-Edit. Press F3, use the button on the SAS toolbar, or select from the context sensitive menu. Your program runs hidden in the background and the results (log and output) display in new edit windows when it completes. It seems that you can get a better response time from SAS if it is left up and running (minimized or hidden behind Multi-Edit).
If your SAS program will run for quite a while, and you want to continue editing you can use context menu item. This will cause SAS to truly run in the background. The down side, you must open the log and or output files manually when SAS completes.
Before you run SAS for the first time you will need to point EZRTools;) at the location of SAS. This can be accomplished by selecting from the context sensitive menu. If you have a new installation you will be prompted to provide the path the first time you try to run SAS. You can use to hop between different release levels if you have multiple installations.
Find Selected Item
Three macros are available to find an item that you have selected. Two of the macros move your cursor to the next or last occurrence of the selected text. The third finds all occurrences and lists them in the Search List (bottom of edit screen). These macros are executed from the context sensitive menu or through key combinations.
Find All (Global)
Select Cntl-Shft-m to find all occurrences of the currently selected string. The menu selection is located under the menu item of the SAS context sensitive menu. is located on the primary context sensitive menu while in LOG files. After you invoke the macro all occurrences of the string in the current file are listed in the Search List. You can hop to that line by double clicking it in the Search List., press SAS toolbar button , or press
Find Forward (Next)
Select Cntl-Shft-n to find the next occurrence of the currently selected string. The menu selection is located under the menu item of the SAS context sensitive menu. is located on the primary context sensitive menu while in LOG files. After you invoke the macro the cursor is moved to the next occurrence of the selected string. The string is highlighted, allowing you to invoke the macro again, or replace the text., press SAS toolbar button or press
Find Backward (Last)
Select Cntl-Shft-b to find the prior occurrence of the currently selected string. The menu selection is located under the menu item of the SAS context sensitive menu. is located on the primary context sensitive menu while in LOG files. After you invoke the macro the cursor is moved to the previous occurrence of the selected string. The string is highlighted, allowing you to invoke the macro again, or replace the text., press SAS toolbar button or press
Viewing the Log and output
Log and Output file names
The log and output file names are created by combining the path and filename of the source code file and replaces the SAS extension with log or out. Both the log and output file are overwritten upon subsequent runs of the same program. If you need to compare logs from multiple runs use the log backup tool.
Subsetting the Log
When you view the log, your context sensitive menu changes. It now has entries to not hidden. The descriptions of what is not hidden are listed below. These functions are also accessed through the LOG toolbar. The toolbar buttons have Shortened versions of the menu item names. is the button, is the button.certain types of lines from the log. This selection displays a sub-menu with entries that indicate what type of lines are
Using a Subset Log
Now that you have reduced the lines shown in the log to some subset of the whole log, what can you do? Notice there are small buttons with a plus sign on the far left of the lines that are visible. You can click on a button and the hidden lines below the button are shown down to the next non-hidden line. At this point the button changes to a minus sign. Clicking this button will re-hides the exposed lines.
The context sensitive menu has an selection tooff and on. This can also be accomplished from the button on the LOG toolbar. When you use this option your cursor remains on the line that it was on (and so does your view). But all the hidden lines are shown. This does not alter the position of the line in the edit window.
Synchronizing Source and Log
While viewing the log, you can put your cursor on any source code line and jump to that line in the code file. If the file is not open in an edit window then it opens. This function only works with source code lines in the log file that also exist in the source code file. For example source located in files %included or autocalled macros would not be found. For best results use list options SOURCE, SOURCE2, MACROGEN If you are executing programs on a remote host, you will need to download the source and log files. They should be named with same major name and extensions of .sas and .log. For example myfile.sas and myfile.log. They should also be located in the same directory. You invoke this function by selecting in the LOG context menu, or press the button on the LOG toolbar.
Backing up the Log File
If you want to use to extensive file compare facilities against logs from two runs of the same program you need to back up your log. The context sensitive menu for log extensions has an item called . This is also located on the SAS context sensitive menu under . You can also press the button on the SAS or LOG tool bars. Selecting this action will create a copy of the log in a sub directory called "backlog" located in the directory containing the log file.
Removing Output Files
The context sensitive menu for SAS files has an entry on the menu to do cleanup log and out files. The entry is under the You are not prompted to confirm.menu called . You can also press the button on the SAS toolbar. Selecting this option will delete all log, backed up log and output files associated with the source file.
Extracting a Table from Output Files
If you need to extract the table data from the output of Procs you can use this tool to do this. Here is an example of Proc Logistics output:
Now to extract this data, for use in a presintation, word doc, whatever, It would be a simple cut and paste, except for... page breaks, repeating headers and SAS time stamps. The table extractor tool makes this job easy. All you need to do is select the table title, in the example above that would be "Analysis of Maximum Likelihood Estimates", with your mouse, and invoke to macro.
How to invoke the macroYou can do this a few different ways. The simplest is use menu item and type sas^tablecut and press . You can also assign it to a control key or a menu item. Note to assign the macro to your sas or log context menus, you will have to add the extension to the extension list for one of those extensions.
To assign to the Context menu
To add the extension to either SAS or LOG extensions selectSelect SAS or LOG and press edit. Then add out to the list of extensions in the upper right hand corner. Now to add the tool to the contect menu select . Select SAS or LOG and press Edit. Select the menu item you want the new entry to be above. Then press Insert. Fill in the menu items text, then click the button next to Command. Then search for "Table Capture", it will be in the EZRTools section. Select this command. Say Ok and your done.
To assign it to a key combination
Go to, set the left side to "General" (at the top) Click on the "Keys/Commands..." button. Then search for "Table Capture", it will be in the EZRTools section. Click on Edit and use the Primary Key area to assign a key combination.
Copyright © 2000- , Martin Works Inc., Text, graphics, and HTML code are protected by US and International Copyright Laws, and may not be copied, reprinted, published, translated, hosted, or otherwise distributed by any means without explicit permission. SAS® is a registered trademark of SAS Institute, Inc. in Cary, NC. Multi-Edit® is a trademark of Multi-Edit Software Inc. All other logos and trademarks in this site are property of their respective owners.