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?
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.