| Getting Started with the SAS System Using SAS/ASSIST Software |
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
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.
-
To create a listing report, you first set up the report by following this selection path:
| Tasks |
![[arrow]](../common/images/arrow.gif) |
Report Writing |
![[arrow]](../common/images/arrow.gif) |
Listing... |
The List a Table window
appears.
List a Table Window
-
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.
-
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.
-
If other report selections exist (for example,
Columns is not -ALL-), follow this selection path to clear these
selections:
| File |
![[arrow]](../common/images/arrow.gif) |
New |
-
To produce a report that lists all the data in the HOUSES table, follow
this selection path:
| Run |
![[arrow]](../common/images/arrow.gif) |
Submit |
The Listing Report appears in the Output
window.
Listing of HOUSES Table
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.
-
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.
-
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. ![[cautend]](../common/images/cautend.gif)
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:
-
Select Subset
data in the List a Table window. The Subset Data window appears.
Subset Data Window
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.
-
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
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:
-
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.
-
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)
-
Select the equal
operator from the Select Data window. The Build a WHERE Clause window reappears.
-
There are two ways to
specify a constant value. Use one of the following methods:
-
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
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.
-
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.
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:
-
Follow this selection path:
| Edit |
![[arrow]](../common/images/arrow.gif) |
Titles... |
The Titles window appears.
Titles Window
-
Select Title
1 from the Titles window. The Title 1 window appears.
Title 1 Window
-
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. ![[cautend]](../common/images/cautend.gif)
After you have finished setting up the report, you
can run the report.
-
Follow this selection path:
| Run |
![[arrow]](../common/images/arrow.gif) |
Submit |
The report appears in
the Output window.
Information on Ranch Style Houses Report
This report
shows all the data for the ranch-style houses in the HOUSES table.
-
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.
If you do not want to print the report, go to the next section. To print the report, follow these
instructions.
-
Follow this selection path from the
Output window:
| File |
![[arrow]](../common/images/arrow.gif) |
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
-
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.
-
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.
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.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.