Chapter Contents |
Previous |
Next |
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.
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.
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.
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 OptionDESCRIBE 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.
proc sql; title 'Subset of the DICTIONARY.INDEX View'; title2 "Rows with Column Name equal to STATE"; select * from dictionary.indexes where name = 'STATE'; quit;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 Column 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 0 MAPS USAAC DATA STATE COMPOSITE CS000000 8 MAPS USAAS DATA STATE SIMPLE STATE . |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.