SAS Dictionary Members and Tables

Get a full list of the dictionary tables in the working session.

PROC SQL;
SELECT *
FROM dictionary.members;
QUIT;

There are following fields in the dictionary.members.

  • libname
  • memname
  • memtype
  • dbms_memtype
  • engine
  • index
  • path

Get number of numeric variables in a table.

Use nvar to get number of variables; use num_numeric to get numeric variables; use num_character to get character variables.

proc sql ;
select num_numeric into :num_vars
from dictionary.tables
where libname=”WORK” and memname=”TABLE1″;
quit;

Note:

  • Capitalize the input for libname and memname
  • Put the input for libname and memname in “”

Layout of dictionary.tables

Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat Label
26 attr Char 3 Data Set Attributes
35 audit Char 3 Audit Trail Active?
37 audit_admin Char 3 Audit Admin Image?
36 audit_before Char 3 Audit Before Image?
39 audit_data Char 3 Audit Data Image?
38 audit_error Char 3 Audit Error Image?
19 bufsize Num 8 Bufsize
13 compress Char 8 Compression Routine
7 crdate Num 8 DATETIME. DATETIME. Date Created
28 datarep Char 32 Data Representation
33 datarepname Char 170 Data Representation Name
4 dbms_memtype Char 32 DBMS Member Type
20 delobs Num 8 Number of Deleted Observations
34 encoding Char 256 Data Encoding
14 encrypt Char 8 Encryption
16 filesize Num 8 Size of File
25 gen Num 8 Generation number
27 indxtype Char 9 Type of Indexes
1 libname Char 8 Library Name
24 maxgen Num 8 Maximum number of generations
23 maxlabel Num 8 Longest label
22 maxvar Num 8 Longest variable name
5 memlabel Char 256 Data Set Label
2 memname Char 32 Member Name
3 memtype Char 8 Member Type
8 modate Num 8 DATETIME. DATETIME. Date Modified
21 nlobs Num 8 Number of Logical Observations
9 nobs Num 8 Number of Physical Observations
15 npage Num 8 Number of Pages
40 num_character Num 8 Number of Character Variables
41 num_numeric Num 8 Number of Numeric Variables
11 nvar Num 8 Number of Variables
10 obslen Num 8 Observation Length
17 pcompress Num 8 Percent Compression
12 protect Char 3 Type of Password Protection
32 reqvector Char 24 $HEX48. $HEX48. Requirements Vector
18 reuse Char 3 Reuse Space
31 sortchar Char 8 Charset Sorted By
29 sortname Char 8 Name of Collating Sequence
30 sorttype Char 4 Sorting Type
6 typemem Char 8 Data Set Type