Saving Source Code for Editing and Re-execution |
Creating Source Code |
The following steps instruct you to generate a listing report and then save the programming statements that are generated for that listing report. For more detailed instructions on how to produce a listing report, refer to Report Writing.
SelectTasks Report Writing ListingThe List a Table window appears.
If the active table is SASUSER.HOUSES, then continue to the next step. Otherwise, select , and then select the SASUSER.HOUSES table. For more information on selecting tables, see Selecting a Table.
If there is an active Subset Data selection (indicated by BY, WHERE, or ROWS next to ), then follow the directions in Clearing a Subset Data Selection.
If other report selections exist (for example, column names are listed for ), then selectFile Newto clear these selections.
If desired, run the report by selectingRun SubmitThe Listing Report appears in the Output window. Note that it is not necessary to run a task before saving its source code.
Return to the List a Table window by using one of the following methods, depending on your operating environment:
Viewing Source Code |
The steps in this section enable you to look at the program that was created by SAS/ASSIST software when you produced the listing report.
From the List a Table window, selectView View sourceThe program that was created when you made the listing report task window selections appears.
Program for Creating Listing Report
Use the scroll bars or the FORWARD, BACKWARD, LEFT, and RIGHT function keys to view the program.
When you finish looking at the program, selectFile Closeto return to the List a Table window.
Saving Source Code |
The steps in this section enable you to save the program that produced the listing report so that you can edit it or re-execute it at a later time.
Follow this selection path from the List a Table window:File Save as sourceThe Save As window appears.
Save As Window
In the Name field, type the name you want to call the program. For this example, type HOUSERPT as the program name.
A program name can be one to eight characters in length. It must start with a letter (A through Z) or an underscore (_), but it can otherwise contain any combination of letters, numbers, and underscores.
In the Description field, type a description of the program. The Description can be up to 32 characters in length and contain any combination of letters, numbers, and other characters. For this example, type Listing of the Houses Table .
The default catalog for saved source code is called SASUSER.PRIVATE, as shown in the previous display. If you want to save the source code in a different catalog, type the catalog name in the Catalog field. For a list of available catalogs, type a question mark (? ) in the Catalog field and press ENTER to display a list of available catalogs. You can select one from this list.
Select to return to the List a Table window. A note appears in the message area to indicate that the program has been successfully saved.
Editing and Re-executing Source Code |
You can use the Result Manager to edit and re-execute the program that you saved in the previous section. For more information on the Result Manager, see Using the Result Manager.
SelectTools Result Managerto invoke the Result Manager. The Result Manager window appears with a list of your saved tasks, output, and programs.
Position the cursor in the space to the left of HOUSREPT. Type E (or S ) and press ENTER. The Edit window appears with your program.
Edit Window
Position the cursor over the semicolon (;) in the line with the footnote statement. Add a footnote by pressing the SPACE BAR, and then typing
SASUSER.HOUSES.DATA;
as shown in the following display.
Modified Source Code
SelectFile Closeto save the edited program and return to the Result Manager window. A prompt appears asking if you want to save the changes to the program. Select .
In the Cmd field for HOUSREPT, type X and press ENTER to re-execute the program and view the footnote you added.
Modified Listing Report Output
To return to the Result Manager window from the Output window, use one of the following methods, depending on your operating environment:
From the Result Manager window, select File Closeto return to the List a Table window.
Exiting This Task |
When you are ready to return to the WorkPlace menu or move on to another task, follow the directions in Exiting a Task.
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.