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

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 827 views
  • 3 likes
  • 4 in conversation