Chapter Contents

Previous

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

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 OS/390 or CMS operating environments, 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 we use the name sampltab in these examples. See the SAS companion for your operating environment, or contact the SAS Software Consultant at your site if you do not know how to perform this step.

    Note:   The name sampltab that we use 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 Program Editor window by using the PREVWIND function key or by clicking on the window, depending on your operating environment. From the Program Editor window, follow this selection path:

    File
    [arrow]
    Open object...
    The 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 apears 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 Open. The Samplsas program appears in the Program Editor window.

  7. Scroll down in the Program Editor window (or use the DOWN function key) until you find the "Supply parameters" section, as shown in the following display.

    SAMPLSAS Source Code

    [IMAGE]

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

  10. If you are using OS/390, 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. (For CMS users, use the name in the following table.) 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
    OS/390 libname &library "userid.assist.sampltab";
    CMS libname &library "SAMPLTAB FILE A";
    OpenVMS libname &library"DEVICE:[SAMPLTAB]";
    UNIX libname &library "/u/userid/assist/sampltab";
    OS/2 or Windows libname &library "C:\assist\sampltab";

  11. To run the program, follow this selection path:

    Run
    [arrow]
    Submit
    After the program finishes, statistics about the created tables appear in the Output window.

    AIRLINE Sample Table Statistics

    [IMAGE]

    Note:   The Airline libref is assigned for the duration of your current SAS session only. The next time you invoke the SAS System 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 the SAS System, 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. Follow this selection path to run the report:

    Run
    [arrow]
    Submit
    The Dynamic Report window appears, with eight buttons for columns defined with GROUP, ACROSS, BREAK, or PAGE usages.

    Dynamic Report Window

    [IMAGE]

  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

    [IMAGE]

    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, the scroll buttons (the small buttons below the eight analysis buttons) contain arrows to indicate the availability of additional columns. Select the right-arrow button 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

    [IMAGE]

  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

    [IMAGE]

  8. To return to the Report Engine window, follow this selection path:

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


Chapter Contents

Previous

Next

Top of Page

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