Chapter Contents

Previous

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

Producing a Listing Report

A listing report displays data from a table. Using the Listing Report task, you can display all the data from a table, or a portion of the data, based on criteria that you specify. By following the instructions in this section, you can produce a report that shows the information for ranch-style homes from the HOUSES table. A listing report displays one line for each observation in the table.

Information on Ranch Style Houses Report

[IMAGE]

A table is a collection of information arranged in columns and rows. A column is a set of data values that represents a particular type of data; for example, the price of all the houses. A row is a set of data values for the same item; for example, all the information about one house, such as price, style, square footage, and so on. Refer to Setting Up SAS Files for more information about tables, rows, and columns.


Setting Up the Report

  1. To create a listing report, you first set up the report by following this selection path:

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

    List a Table Window

    [IMAGE]

  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 with BY, WHERE, or ROWS next to the Subset data button), clear the selection. For more information, see Clearing a Subset Data Selection.

  4. If other report selections exist (for example, Columns is not -ALL-), follow this selection path to clear these selections:

    File
    [arrow]
    New

  5. To produce a report that lists all the data in the HOUSES table, follow this selection path:

    Run
    [arrow]
    Submit
    The Listing Report appears in the Output window.

    Listing of HOUSES Table

    [IMAGE]

    The listing report is a quick way to get a list of all the data in your table. Note the different styles of the houses. For the sample report shown in Information on Ranch Style Houses Report, only the RANCH style houses are selected.

  6. If the report is wider or longer than the window, use the scroll bars or the FORWARD, BACKWARD, LEFT, and RIGHT function keys to look at the rest of the report. Refer to Using Function Keys for further information on function keys.

  7. After you have finished looking at the report, return to the List a Table window by using one of the following methods, depending on your operating environment:

    Note:   Under some operating environments, if you are using the Output window and the report is longer than one display, the last display of the report is shown after you select Close once. In this case, select File and then Close again. The task window reappears.  [cautionend]


Subsetting the Data

To produce the report shown in Information on Ranch Style Houses Report, you need to subset and customize the report. Subset the data as follows:

  1. Select Subset data in the List a Table window. The Subset Data window appears.

    Subset Data Window

    [IMAGE]

    You subset the data if you want to produce a report that uses only some of the data in the table. For example, to produce the sample report shown in Information on Ranch Style Houses Report, you need to subset the data so that only data for ranch-style houses are used.

  2. Select WHERE clause. The Build a WHERE Clause to Subset the Current Data window appears.

    Build a WHERE Clause to Subset the Current Data Window

    [IMAGE]

    This window enables you to create a WHERE clause that specifies criteria for selecting rows. The rows that match the criteria in the WHERE clause are used in the report. For this example, you build a WHERE clause that selects only the houses where STYLE=RANCH.

    You subset the data by using one of the following methods:

  3. To build the WHERE clause using the items in the window, select Column from the Build a WHERE Clause window, and then select the STYLE column. For more information, see Selecting a Column.

  4. Select Comparison operator from the Build a WHERE Clause window. A window with a list of valid comparison operators appears.

    Select Data Window (Comparison Operators)

    [IMAGE]

  5. Select the equal operator from the Select Data window. The Build a WHERE Clause window reappears.

  6. There are two ways to specify a constant value. Use one of the following methods:

  7. Select OK. The Build a WHERE Clause window reappears. The WHERE clause that you built is shown under the WHERE clause being built item as shown in the following display.

    Completed WHERE Clause

    [IMAGE]

    To make changes to the WHERE clause, select Edit the WHERE clause. You can then make changes to the column, comparison operator, and constant.

    Note that in certain operating environments, there is an additional option to Verify where clause against data. If you select this option, SAS software checks to see if there are any rows that meet the conditions of your WHERE clause. If your table is very large, this verification can take a long time.

  8. Select OK and then Goback to return to the List a Table window. Notice that the value for the Subset data field is WHERE. This indicates that a WHERE clause is being used to subset your data.


Adding Titles

You can customize the report by adding titles and footnotes, changing the page dimensions, and selecting headings. Follow these directions to add a title to your report:

  1. Follow this selection path:

    Edit
    [arrow]
    Titles...
    The Titles window appears.

    Titles Window

    [IMAGE]

  2. Select Title 1 from the Titles window. The Title 1 window appears.

    Title 1 Window

    [IMAGE]

  3. In the Title 1 field, type the title exactly as you want it to appear on the report. For this report, type the title Information on Ranch Style Houses. Select OK twice to return to the List a Table window.

    Note:   Because the same set of titles and footnotes is used for all SAS/ASSIST tasks, the titles and footnotes most recently used in your SAS/ASSIST session are used unless you change or reset them. If a title already exists when you open the Titles window, type the new title over the old title.  [cautionend]


Running the Report

After you have finished setting up the report, you can run the report.

  1. Follow this selection path:

    Run
    [arrow]
    Submit
    The report appears in the Output window.

    Information on Ranch Style Houses Report

    [IMAGE]

    This report shows all the data for the ranch-style houses in the HOUSES table.

  2. If the report is wider or longer than the window, use the scroll bars or the FORWARD, BACKWARD, LEFT, and RIGHT function keys to look at the report.


Printing the Report

If you do not want to print the report, go to the next section. To print the report, follow these instructions.

  1. Follow this selection path from the Output window:

    File
    [arrow]
    Print
    Depending on your operating environment, the output may be sent directly to your default printer, or you may see the Print window, where you can select printing options.

    Print Window

    [IMAGE]

  2. Make sure the name of your default printer (or some other printer of your choosing) appears in the Default Printer field in the Print window. If it does not, select Setup... and choose your printer from the list that appears. If you do not know which printer to choose, contact the SAS Support Consultant at your site.

  3. To print the current report, select Print in the Print window. The report is sent to your printer, and a message appears in the Output window indicating how many lines were printed.

Note:   If you are generating HTML output, you can view the report in your HTML browser and print using the browser's print function. See Setting Up HTML Output for details on HTML output with SAS/ASSIST software.  [cautionend]


Exiting This Task

When you have finished viewing or printing your report, return to the List a Table window by using one of the following methods, depending on your operating environment:

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.