proc dataset

Accepted Solution Solved
Reply
Valued Guide
Posts: 858
Accepted Solution

proc dataset

I would like to pull proc dataset information from all of the datasets that contain a 'facility_id' variable in them.  Is there any way to do a search like that?  I'm looking at a library that has several hundred tables and I only want the tables with that specific variable.

Thank You in advance,

Mark


Accepted Solutions
Solution
‎11-13-2014 09:45 AM
Super User
Super User
Posts: 7,401

Re: proc dataset

Dictionary tables comes from SQL, they are pretty much interchangeable with SASHELP.VTABLE/VCOLUMNS, and are the metadata for the table.  E.g.

proc sql;

  create table TMP as

  select * from DICTIONARY.TABLES;

quit;

View solution in original post


All Replies
Super User
Super User
Posts: 7,401

Re: proc dataset

No probs.  Check out the SAS metadata tables:

proc sql;

     create table WANT as

     select     *

     from       SASHELP.VCOLUMNS  /* Could also use dictionary tables */

     where     MEMNAME in (select distinct MEMNAME from SASHELP.VCOLUMNS where NAME="FACILITY_ID");

quit;

The above will show you the metadata for all tables which have that variable in.

Respected Advisor
Posts: 3,124

Re: proc dataset

,

Unlike libname and memname, the variable names are stored 'as-is' in this view, so on the safe side,

where upcase(name)='FACILITY_ID'

Regards,

Haikuo

Valued Guide
Posts: 858

Re: proc dataset

I do not know what you mean by dictionary tables.

Solution
‎11-13-2014 09:45 AM
Super User
Super User
Posts: 7,401

Re: proc dataset

Dictionary tables comes from SQL, they are pretty much interchangeable with SASHELP.VTABLE/VCOLUMNS, and are the metadata for the table.  E.g.

proc sql;

  create table TMP as

  select * from DICTIONARY.TABLES;

quit;

Frequent Contributor
Posts: 96

Re: proc dataset

Hi there,

I think we may avoid use of "DICTIONARY.TABLES" when we are searching for datasets based on a particular variable. Dictionary.tables do not provide information related to variable name which are available in SASHELP. VCOLUMN.

 

Regards,

Deepak

Swain
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 530 views
  • 7 likes
  • 4 in conversation