Hi All,
I need to find all the datasets with zero observation in a library. How should I do that? Any suggestion is highly appreciated.
Thanks - Linlin
Linlin,
Could you use dictionary.tables to find your info? there is a variable 'nobs' delivering what you need.
Haikuo
Linlin,
Could you use dictionary.tables to find your info? there is a variable 'nobs' delivering what you need.
Haikuo
Hi Haikuo,
Thank you very much! - Linlin
My code:
proc sql;
create table want as
select memname,nobs
from dictionary.tables
where libname='WORK' and memname like "_%" and nobs=0;
quit;
proc print data=want;
run;
Recommend you use nlobs to instead fo nobs.
When Some data set be modified directly ,not random modified, NOBS will return not exactly the nobs.
Good point. Thank you Ksharp! - Linlin
proc sql noprint;
create table temp/* if you want it use in a dataset*/ as select libname as library_name,
memname as Name
from sashelp.Vtable where Libname="Work" /* you can use any library*/
and nobs=0;
select count(*)
into:Nobs
from temp;
Select Name
into :Name1-:Name%left(&Nobs)
from temp;
quit;
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!
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.