BookmarkSubscribeRSS Feed
Tecla1
Quartz | Level 8

Good afternoon,

I have a library with more tables i need to create a new table who contains all the names of columns  (of all tables) and in wich table the column name is contained.

 

Can you suggest something?

 

Tnks!!!!

 

Tecla

3 REPLIES 3
PaigeMiller
Diamond | Level 26

The work is already done for you. Use the DICTIONARY table.

 

proc sql;
    create table want as select * from dictionary.columns;
quit;
--
Paige Miller
ballardw
Super User
proc sql;
    create table want as select * from dictionary.columns
       where libname='YOURLIB'
   ;
quit;

The libname (as well as memname for datasets) is stored in the dictionary view in all upper case so either provide the name in upper case or use other method to ensure your name value and the libname is the same case for comparison

 

Jagadishkatam
Amethyst | Level 16

Alternatively with a dataset

 

data want;
set sashelp.vcolumn;
where libname='WORK';
run;
Thanks,
Jag

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1140 views
  • 3 likes
  • 4 in conversation