Charting query results as a user-defined map

You can chart query results as a map by using QMF Analytics for TSO.

About this task

Maps render query results on to defined area.

This topic provides an example for charting information geographically by using a user-defined map.

In the example you map rainfall data from a climate query to a defined geographic region (eight states of the United States). Say you worked for a company that manufactured and distributed foul-weather gear. A map that shows which of eight states have the heaviest rainfall might be useful for communicating and explaining sales strategy.

This procedure uses the Q.CLIMATE_USA and Q.MAPUSA sample tables.


  1. Start QMF for TSO.

    Your QMF administrator can tell you how to start a QMF session and give you a user ID. Check with your QMF administrator if you have any questions about getting started with QMF.

  2. From the QMF Home Panel, enter DISPLAY Q.CLIMATE_USA on the command line and press Enter.

    QMF for TSO displays the query result as a multi-columned report.

    Figure 1. Query Results
    REPORT           Q.CLIMATE_USA    LINE 1      POS 1      79    
            MONTH  STATE      TEMPMIN      TEMPMAX     RAINFALL     SUNSHINE    
      -----------  -------  -----------  -----------  -----------  -----------    
                1  AK                 9           25            1            1    
                1  AL                23           61           11           34    
                1  AR                19           50           12            1    
                1  AZ                12           68            7           80    
                1  CA                19           72           18           41    
                1  CO               -13           50            1           51    
                1  CT                18           39            3            1    
                1  DE                25           37            3           11    
                1  FL                34           70           12           83    
                1  GA                25           55            9           45    
                1  HI                63           82            7          133    
                1  IA                -6           27            4            1    
                1  ID                12           50            4           29    
                1  IL                 9           36            2           10    
                1  IN                 9           32            4            1    
                1  KS                 9           54            3           50    
                1  KY                18           36            6            1    
                1  LA                27           63           10           51    
                1  MA                12           39            5            1    
                1  MD                19           39            9            1    
                1  ME                 5           28            4            1    
                1  MI                 9           34            3            1    
                1  MN                -2           19            3            1    
                1  MO                 9           37           10            1    
                1  MS                28           57            6           44    
                1  MT                 1           39            5            1    
                1  NC                14           50            8           23    
                1  ND                -6           23            3            1    
                1  NE                 3           41            3           10    
                1  NH                10           32            1            1    
                1  NJ                21           41            2           11    
                1  NM                 5           54            4           48    
                1  NV                10           57            2           58    
    1=Help         2=            3=End       4=Print       5=Chart        6=Query 
    7=Backward     8=Forward     9=Form     10=Left       11=Right       12=      
    OK, Q.CLIMATE_USA is displayed.                                               
    COMMAND ===>                                                  SCROLL ===> PAGE
  3. Enter SHOW ANALYTICS on the command line and press Enter to start QMF Analytics for TSO.
  4. Tab to Map in the Charts section of the QMF Analytics for TSO Home panel and press Enter.

    The Parameter Selection panel is displayed.

  5. Create the specification for your analysis.
    Set your parameters as shown in the following table.

    In the Parameter Selection panel, set cursor to the field Specify the location to be mapped, press F4 to open the Coordinate Table Selection dialog, and press F4 (New) to create a user-defined map.

    In the User Coordinate Table Selection dialog, specify the table that you want to use for building the map:
    1. Select the database from that you want to use the coordinate table. If you select TSO, specify the CSV delimiter and header options.
    2. In the Short Name field enter the name for the table that you want use for it in the Coordinate Table Selection dialog.
    3. In the Coordinate table name field, type the table name in the database.
    4. Press F2 to save the user-defined map and return to the Parameter Selection panel.
    Table 1. Parameter Settings for User-defined Map
    Parameter Setting
    Table Location Db2®
    Short Name USERMAP
    Coordinate Table Name Q.MAPUSA

    You can enter column names manually or you can tab to the field and press the List function key (F4).

    The List function opens a Column Selection window that lists all of the column names from the query result. To select a column from the Column Selection window, tab to the column name and press Enter. QMF Analytics for TSO adds the name to the Parameter Selection panel automatically.

    Table 2. Parameter Settings for Map
    Parameter Setting
    Specify the column which contains the data to be mapped RAINFALL
    Specify the column which links the data to the map coordinates STATE
    Specify the location to be mapped USERMAP
    Chart Title

    Enter a title or accept the default asterisk (*).

    If you accept the default value of asterisk (*), QMF Analytics for TSO creates a title based on the columns that you have selected.

    If you delete the asterisk (*) and leave this field blank, the analysis output will not include a title.

  6. Optional: Press the Save function key (F5) to save the specification to the QMF database as an ANALYTIC object.
    Saving the specification to the database allows you to run your analysis directly from the QMF command line at a later time, without having to navigate to the QMF Analytics for TSO Home panel and reenter the parameters. Saving specifications makes sense if you plan on running the analysis frequently or multiple times.
    Note: The global variable DSQEC_SESSGLV_SAV in QMF controls how the autosave for parameter settings works. For information about Global Variables, see Global Variable List in the QMF help.
  7. Press the Run function key (F2) to generate the map.
    Figure 2. Map of Rainfall in the eight states of the Unites States
    Rainfall Data for United States Screen capture

    The map generated is color-coded and includes a key for associating colors to rainfall amount. In this example you can see that Washington state receives the highest amount of rainfall of all the states

  8. Press the End function (F3) key to return to the Parameter Selection panel.
  9. Press the End function key again to return to the QMF Analytics for TSO Home panel.
  10. Press the End function key again to return to the query results.
  11. Optional: If you have configured print capabilities in QMF, you can print the map.