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
The work is already done for you. Use the DICTIONARY table.
proc sql;
create table want as select * from dictionary.columns;
quit;
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
Alternatively with a dataset
data want;
set sashelp.vcolumn;
where libname='WORK';
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.