BookmarkSubscribeRSS Feed
Ashwini
Calcite | Level 5

Kindly let me know how we know library name of a table by using base programing code.

Regards,

Ashwini

5 REPLIES 5
Ksharp
Super User

An easy way is useing dictionary table.

proc sql;
 select libname,memname
  from dictionary.members
   where memname='CLASS';
quit;


Ksharp

Ashwini
Calcite | Level 5

Dear Ksharp,

If it table is an sql table then we use Dictionay.But i have table ,i don't know the library or location of table .I know only the name of table.How we can search a table by using base code.

Regard,

Ashwini

art297
Opal | Level 21

What Ksharp referred to was a table of tables, not a sql specific table.

If you are talking about a table that is already in a libname that has already been assigned during a session, then his proposed code should accomplish what you want.

Ksharp
Super User

As long as you know the name of table , the code you give you all the library name which contains the table name you want to search.

E.X.

If you want to find all the library which contain a table named 'CLASS' ,then the code below will list all the libraries.

proc sql;

select libname,memname

  from dictionary.members

   where memname='CLASS';

quit;

Ksharp

art297
Opal | Level 21

While KSharp may have already answered your question, I'm not sure!  Is that what you meant or were you asking something else?

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1043 views
  • 0 likes
  • 3 in conversation