BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Steelers_In_DC
Barite | Level 11

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

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Haikuo
Onyx | Level 15

,

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

Steelers_In_DC
Barite | Level 11

I do not know what you mean by dictionary tables.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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;

DeepakSwain
Pyrite | Level 9

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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