Hello,
I have elaborate a simple macro to get the dataset list in a library as well as the number of observations.
However depending on the engine use into the base or spde, my macro need to be adapted.
For the first call, the library use base engine so I need to eliminate the spde wording from the macro, while the second
library use spde engine and the macro work perfectly.
Is there a way to check which engine is use in a library in other the make this macro more versatile.
Regards,
Alain
%MACRO nbobsindataset(path=);
libname SOURCE spde "&path.";
Proc sql;
create table want as
select libname,memname, nobs
from dictionary.tables
where libname='SOURCE'
;
QUIT;
%mend nbobsindataset;
/*%nbobsindataset(path=/.../data/bkp);*/
%nbobsindataset(path=/.../sas20206/wc/folder1);
Close SASHELP.VLIBNAM
or
14 Proc sql; 15 describe table dictionary.libnames; NOTE: SQL table DICTIONARY.LIBNAMES was created like: create table DICTIONARY.LIBNAMES ( libname char(8) label='Library Name', engine char(8) label='Engine Name', path char(1024) label='Pathname', level num label='Library Concatenation Level', fileformat char(8) label='Default File Format', readonly char(3) label='Read-only?', sequential char(3) label='Sequential?', sysdesc char(1024) label='System Information Description', sysname char(1024) label='System Information Name', sysvalue char(1024) label='System Information Value', temp char(3) label='Temp Access?' ); 16 quit;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.