Using the Report Engine |
Dynamic reports enable you to set up a report and then drill down to view more details of the report.
Creating the AIRLINE Sample Tables |
To appreciate the power of the dynamic report, you should use large and complex tables. This section shows you how to create the AIRLINE sample tables, a set of tables for a fictitious airline company called International Airways. The AIRLINE sample tables are more complex than the SAS/ASSIST sample tables. There are tables with employee information as well as tables with information about flights, delays, boarding numbers, and so on. To create the AIRLINE tables, follow these steps:
If you are using the z/OS operating environment, continue to step 2. Otherwise, create a library, directory, or folder, depending on your operating environment, where you want the AIRLINE sample tables to reside. You may name this library or directory anything you want, but these examples use the name sampltab . See the SAS companion for your operating environment, or contact the SAS Support Consultant at your site if you do not know how to perform this step.
Note: The name sampltab that is used in these examples is the physical file or directory name. Do not confuse this name with the libname, which you will specify in a later step.
Go to the Editor or Program Editor window by using the PREVWIND function key or by clicking on the window, depending on your operating environment. Then selectFile Open objectThe Select an Entry or Open window appears with a list of available libraries in the left pane.
Select the symbol next to the Sashelp library. The contents of the Sashelp library appear in the left pane.
Scroll down in the left pane until you see the Qassist catalog. Select the Qassist catalog. A list of entries in the Qassist catalog appears in the right pane.
Scroll down in the right pane until you see the Samplsas source entry. Select the Samplsas source entry.
Select . The Samplsas program appears in the Editor or Program Editor window.
Scroll down in the window (or use the DOWN function key) until you find the "Supply parameters" section, as shown in the following display.
SAMPLSAS Source Code
* libname &library "&sysjobid..sas.assist.sampltab";
You may need to scroll further down to find this line. This line is the LIBNAME statement that SAS uses to assign a libref to a physical file or directory. For more information on librefs, see SAS Data Libraries.
Remove the * by placing the cursor over it and pressing the SPACE BAR or DELETE key.
If you are using z/OS, continue to the next step. Otherwise, replace the information between the quotation marks (") with the name of the library or directory you created in step 1. Use the following table as a guide. Ensure that the name is enclosed in quotation marks and that a semicolon (;) is at the end of the line.
Operating Environment | Example |
---|---|
z/OS | libname &library "userid.assist.sampltab"; |
OpenVMS | libname &library "DEVICE:[SAMPLTAB]"; |
UNIX | libname &library "/u/userid/assist/sampltab"; |
Windows | libname &library "C:\assist\sampltab"; |
To run the program, selectRun SubmitAfter the program finishes, information about the created tables appears in the Output window.
AIRLINE Sample Table Information
Note: The Airline libref is assigned for the duration of your current SAS session only. The next time you invoke SAS and SAS/ASSIST software, you will need to assign the libref again by following the directions in Using SAS/ASSIST Software to Assign a New Libref. Alternatively, you can specify that the Airline libref be automatically defined, each time you invoke SAS, by assigning the libref in the SAS Explorer window. See the online help for the SAS Explorer window for details.
Return to the Report Engine window by using the PREVWIND or NEXT function keys, or by clicking on the SAS/ASSIST window, depending on your operating environment.
Creating the Report |
To create a dynamic report, you must add usages to the Usage column. Usages determine what a column represents and change the appearance of a report. For dynamic reports, usages determine the columns on which you can drill down.
Type AIRLINE.MARCH and then press ENTER in the Report Engine window's Data field.
For each column, enter the usage and column header indicated in the following table. Use the TAB key to move from field to field.
Column No. | Usage | Column Header |
---|---|---|
1 | GROUP | Flight |
2 | ACROSS | Date |
3 | GROUP | Time |
4 | SUM | |
5 | SUM | Freight |
6 | SUM | Boarded |
7 | SUM | Transfer |
8 | SUM | Non-pay |
9 | SUM | Deplane |
10 | GROUP | Capacity |
The usages for the columns create a drill-down report that shows the sum of the mail, freight, number of passengers boarded, number of passengers transferred, number of nonpaying passengers, and the number of disembarked passengers. Each of the columns can be shown by flight number, departure time, capacity, and date. The column headers have been shortened so that they fit in the Dynamic Report window buttons.
To run the report, selectRun SubmitThe Dynamic Report window appears, with eight buttons for columns that are defined with GROUP, ACROSS, BREAK, or PAGE usages.
Dynamic Report Window
Select to obtain a list of all the flights along with the figures for mail, freight, boarded passengers, transferred passengers, nonpaying passengers, and deplaned passengers.
Information by Flight Number
The figures for nonpaying passengers and deplaned passengers do not initially appear. If the report has more columns than can be displayed in the window, then the scroll buttons (the small buttons below the eight analysis buttons) contain arrows to indicate the availability of additional columns. Select the right arrow to see columns to the right. Each time you select a scroll button, one new column appears.
Drill down on Flight 202 by selecting 202 in the table, and then selecting . The figures for Flight 202 for each date appear.
Information by Date for Flight 202
Drill down on 05MAR94 and select to display the capacity figures for Flight 202 on March 5, 1994.
Capacity Information for Flight 202 on March 5, 1994
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.