Chapter Contents

Previous

Next
The SQL Procedure

Example 6: Reporting from DICTIONARY Tables


Procedure features:
DESCRIBE TABLE statement
DICTIONARY.table-name component
Table: DICTIONARY.MEMBERS

This example uses DICTIONARY tables to show a list of the SAS files in a SAS data library. If you do not know the names of the columns in the DICTIONARY table that you are querying, use a DESCRIBE TABLE statement with the table.


Program

libname proclib 'SAS-data-library';
 Note about code
options nodate pageno=1 source linesize=80 pagesize=60;
 Note about code
proc sql;
   describe table dictionary.members;
 Note about code
   title 'SAS Files in the PROCLIB Library';
   select memname, memtype
      from dictionary.members
      where libname='PROCLIB';


Log

2  options nodate pageno=1 source linesize=80 pagesize=60;
3  proc sql;
4     describe table dictionary.members;
NOTE: SQL table DICTIONARY.MEMBERS was created like:

create table DICTIONARY.MEMBERS
  (
   libname char(8) label='Library Name',
   memname char(32) label='Member Name',
   memtype char(8) label='Member Type',
   engine char(8) label='Engine Name',
   index char(32) label='Indexes',
   path char(1024) label='Path Name'
  );

5     title 'SAS Files in the PROCLIB Library';
6     select memname, memtype
7        from dictionary.members
8        where libname='PROCLIB';


Output
[HTML Output]  [Listing Output]


Chapter Contents

Previous

Next

Top of Page

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