Chapter Contents

Previous

Next
Getting Started with the SAS System Using SAS/ASSIST Software

Working With Source Code


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.

  1. Follow this selection path:

    Tasks
    [arrow]
    Report Writing
    [arrow]
    Listing...
    The List a Table window appears.

  2. If the active table is SASUSER.HOUSES, continue to the next step. Otherwise, select Table, and then select the SASUSER.HOUSES table. For more information on selecting tables, see Selecting a Table.

  3. If there is an active Subset Data selection (indicated by BY, WHERE, or ROWS next to the Subset data button), follow the directions in Clearing a Subset Data Selection.

  4. If other report selections exist (for example, column names are listed for Columns), follow this selection path to clear these selections:

    File
    [arrow]
    New
    Select No in the Save Changes dialog box.

  5. To run the report, follow this selection path:

    Run
    [arrow]
    Submit
    The Listing Report appears in the Output window. Note that it is not necessary to run a task before saving it.

  6. 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.

  1. Follow this selection path from the List a Table window:

    View
    [arrow]
    View source
    The program that was created when you produced the listing report appears.

    Program for Creating Listing Report

    [IMAGE]

  2. Use the scroll bars or the FORWARD, BACKWARD, LEFT, and RIGHT function keys to view the program.

  3. When you finish looking at the program, follow this selection path to return to the List a Table window:

    File
    [arrow]
    Close


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.

  1. Follow this selection path from the List a Table window:

    File
    [arrow]
    Save as source...
    The Save As window appears.

    Save As Window

    [IMAGE]

  2. 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.

  3. 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.

  4. 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 ? in the Catalog field and press ENTER to display a list of available catalogs. You can select one from this list.

  5. Select OK 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 you saved in the previous section. For more information on the Result Manager, see Using the Result Manager.

  1. Follow this selection path to invoke the Result Manager:

    Tools
    [arrow]
    Result Manager
    Select No in the Save Changes dialog box. The Result Manager window appears with a list of your saved tasks, output, and programs.

  2. 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

    [IMAGE]

  3. 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

    [IMAGE]

  4. Follow this selection path to save the edited program and return to the Result Manager window:

    File
    [arrow]
    Close
    A prompt appears asking if you want to save the changes to the program. Select Yes.

  5. In the selection field next to HOUSREPT, type X and press ENTER to re-execute the program and view the footnote you added.

    Modified Listing Report Output

    [IMAGE]

  6. To return to the Result Manager window from the Output window, use one of the following methods, depending on your operating environment:

  7. To return to the List a Table window, follow this selection path from the Results window:

    File
    [arrow]
    End
    The List a Table window reappears.


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.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.