Hello all,
Does anyone have a hint on how I can read just the table names in an entire MS SQL libname into sas?
For example:
proc sql;
create table temp as
SELECT TABLE_NAME
FROM my_lib.[INFORMATION_SCHEMA].[COLUMNS]
WHERE TABLE_NAME LIKE 'xw_%';
QUIT;
I have tried dropping the [], I have tried dropping ".[COLUMNS]"
I have tried making a temp table from the source MS SQL DB on this data, so I can just read a non-schema table directly like any other regular data set. It shouldn't be that hard what am I missing?
last I have tried a proc
print data=sashelp.vcolumn noobs;
var memname name type [... etc];
where libname='my_lib';
run;
This last item seems to have hung my SAS app. I can read and write to this libname for other tables. TIA.
Also for sashelp.vcolumns the entries are case sensitive.
Youve stated table names, is there a reason your not using vtable instead of vcolumn?
Try a proc datasets though sometimes for DB it's all blanks.
See the output from the following.
Proc datasets library=libname;
run;quit;
Also for sashelp.vcolumns the entries are case sensitive.
Youve stated table names, is there a reason your not using vtable instead of vcolumn?
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.
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.
Ready to level-up your skills? Choose your own adventure.