BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Linlin
Lapis Lazuli | Level 10

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

1 ACCEPTED SOLUTION

Accepted Solutions
Haikuo
Onyx | Level 15

Linlin,

Could you use dictionary.tables to find your info? there is a variable 'nobs' delivering what you need.

Haikuo

View solution in original post

5 REPLIES 5
Haikuo
Onyx | Level 15

Linlin,

Could you use dictionary.tables to find your info? there is a variable 'nobs' delivering what you need.

Haikuo

Linlin
Lapis Lazuli | Level 10

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;

Ksharp
Super User

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.

smonodeep
Calcite | Level 5

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;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1012 views
  • 4 likes
  • 4 in conversation