Previous Page | Next Page

Using the Report Engine

Creating a Dynamic Report

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:

  1. 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.  [cautionend]

  2. 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 [arrow] Open objectThe Select an Entry or Open window appears with a list of available libraries in the left pane.

  3. Select the + symbol next to the Sashelp library. The contents of the Sashelp library appear in the left pane.

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

  5. Scroll down in the right pane until you see the Samplsas source entry. Select the Samplsas source entry.

  6. Select OK. The Samplsas program appears in the Editor or Program Editor window.

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

    [SAMPLSAS Source Code]

  8. Find the line that reads

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

  9. Remove the * by placing the cursor over it and pressing the SPACE BAR or DELETE key.

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

    Examples of LIBNAME Statements
    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";

  11. To run the program, selectRun [arrow] SubmitAfter the program finishes, information about the created tables appears in the Output window.

    AIRLINE Sample Table Information

    [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.  [cautionend]

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

  1. Type AIRLINE.MARCH and then press ENTER in the Report Engine window's Data field.

  2. For each column, enter the usage and column header indicated in the following table. Use the TAB key to move from field to field.

    Preparing the Dynamic Report
    Column No. Usage Column Header
    1 GROUP Flight
    2 ACROSS Date
    3 GROUP Time
    4 SUM Mail
    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.

  3. Type DRILL in the Report field, and then press ENTER.

  4. To run the report, selectRun [arrow] SubmitThe Dynamic Report window appears, with eight buttons for columns that are defined with GROUP, ACROSS, BREAK, or PAGE usages.

    Dynamic Report Window

    [Dynamic Report Window]

  5. Select Flight 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

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

  6. Drill down on Flight 202 by selecting 202 in the table, and then selecting Date. The figures for Flight 202 for each date appear.

    Information by Date for Flight 202

    [Information by Date for Flight 202]

  7. Drill down on 05MAR94 and select Capacity to display the capacity figures for Flight 202 on March 5, 1994.

    Capacity Information for Flight 202 on March 5, 1994

    [Capacity Information for Flight 202 on March 5, 1994]

  8. To return to the Report Engine window, selectFile [arrow] Close


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.

Previous Page | Next Page | Top of Page