Chapter Contents



How to View DICTIONARY Tables


You may want to view the contents of DICTIONARY tables to see information about your current SAS session, prior to actually using the table in a SAS DATA step or a SAS procedure. Because DICTIONARY tables are SAS data views, you can use a DESCRIBE TABLE statement in PROC SQL, or you can use the SAS Explorer window to examine their contents. Depending on how you use SAS, some DICTIONARY tables may become quite large. In this case, you may want to view a part of a DICTIONARY table that contains only the data you are interested in. The best way to view part of a DICTIONARY table is to subset the table using a PROC SQL WHERE clause.

How to View an Entire DICTIONARY Table

You can see all the contents of a DICTIONARY table using the SAS Explorer Window. This is more detail than you receive in the output of the DESCRIBE TABLE statement, as shown in the next section.

The following steps describe how to use SAS Explorer to view a DICTIONARY table in a windowing environment. If you use an operating environment that does not have a mouse, use the tab key to select the appropriate field, then press the Enter key.

  1. Invoke the Explorer window in your SAS session.

  2. Click on the library Sashelp (do not click on the + symbol, click on the word Sashelp). A list of members of the SASHELP library is displayed.

  3. Click on a DICTIONARY table. A VIEWTABLE screen appears that contains its contents.

For example, there is a dictionary table called "vindex" that contains information about indexes. Other dictionary tables begin with the letter v and have the same type of icon.

The column headings you see in the VIEWTABLE screen are labels. To see what the name of the column heading actually is, click on the column heading. This invokes the SAS: Column Attributes screen, where the real column name, the name that you need to use when writing a SAS statement, is listed.

How To View a Summary of a Dictionary Table

The DESCRIBE TABLE statement in PROC SQL produces a summary of the contents of a dictionary table. Here is an example of using the DESCRIBE TABLE statement to generate a summary for the dictionary table called DICTIONARY.INDEXES. (From the Explorer window, this file name appears as SASHELP.VINDEX).

 proc sql; 
   describe table dictionary.indexes;

The result of the DESCRIBE TABLE statement:

libname char(8) label='Library Name',
memname char(32) label='Member Name',
memtype char(8) label='Member Type',
idxusage char(9) label='Column Index Type', 
name char(32) label='Column Name', 
indxname char(32) label='Index Name', 
indxpos num label='Position of Column in Concatenated Key',
nomiss char(3) label='Nomiss Option',
unique char(3) label='Unique Option  
DESCRIBE TABLE output defined:

After you know how a table is defined, you can use the processing ability of the PROC SQL WHERE clause in a PROC SQL step to extract a portion of a view.

How to View a Subset of a Dictionary Table

When you know that you are dealing with a large dictionary and you only need to use a portion of it, use a PROC SQL WHERE clause to extract a subset of the original. The following PROC SQL statement demonstrates the use of a PROC SQL WHERE clause to extract lines from DICTIONARY.INDEXES and produces output in the log.

proc sql;
   title 'Subset of the DICTIONARY.INDEX View';
   title2 "Rows with Column Name equal to STATE";
   select * from dictionary.indexes
      where name = 'STATE';
The results are shown in the following output:

Result of the PROC SQL Subsetting WHERE Statement
                                                Subset of the DICTIONARY.INDEX View                  15:19 Tuesday, June 1, 1999   2
                                                Rows with Column Name equal to STATE

Library                                     Member                                      Index
Name      Member Name                       Type      Column Name                       Type       Index Name
 Position of
   Column in
Concatenated  Nomiss  Unique
         Key  Option  Option
MAPS      USAAC                             DATA      STATE                             COMPOSITE  SC000000                        

MAPS      USAAC                             DATA      STATE                             COMPOSITE  CS000000                        

MAPS      USAAS                             DATA      STATE                             SIMPLE     STATE                           

Chapter Contents



Top of Page

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