<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to identify empty datasets ,datasetnames ,observartions count ,variable names  info in a Library in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-identify-empty-datasets-datasetnames-observartions-count/m-p/954996#M372977</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro create_empty_datasets;
    %do i = 1 %to 100;
        data lib1.ds_&amp;amp;i;
        run;
    %end;
%mend;

%create_empty_datasets;
proc sql;
create table s as
    select libname, memname,memtype
    from dictionary.tables
    where libname = 'LIB1' /* Change to your library name if different */
      and nobs = 0 /* Filters datasets with zero observations */;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here I created 100 datasets&amp;nbsp; so how to identify empty datasets ,datasetnames ,observartions count ,variable names info in a Library&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jan 2025 08:16:14 GMT</pubDate>
    <dc:creator>pavank</dc:creator>
    <dc:date>2025-01-03T08:16:14Z</dc:date>
    <item>
      <title>How to identify empty datasets ,datasetnames ,observartions count ,variable names  info in a Library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-identify-empty-datasets-datasetnames-observartions-count/m-p/954996#M372977</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro create_empty_datasets;
    %do i = 1 %to 100;
        data lib1.ds_&amp;amp;i;
        run;
    %end;
%mend;

%create_empty_datasets;
proc sql;
create table s as
    select libname, memname,memtype
    from dictionary.tables
    where libname = 'LIB1' /* Change to your library name if different */
      and nobs = 0 /* Filters datasets with zero observations */;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here I created 100 datasets&amp;nbsp; so how to identify empty datasets ,datasetnames ,observartions count ,variable names info in a Library&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 08:16:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-identify-empty-datasets-datasetnames-observartions-count/m-p/954996#M372977</guid>
      <dc:creator>pavank</dc:creator>
      <dc:date>2025-01-03T08:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify empty datasets ,datasetnames ,observartions count ,variable names  info in a Lib</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-identify-empty-datasets-datasetnames-observartions-count/m-p/955001#M372978</link>
      <description>&lt;P&gt;First of all, you didn't create 100 empty data sets each of :&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;data lib1.ds_&amp;amp;i;
run;&lt;/LI-CODE&gt;
&lt;P&gt;has exactly one observation and zero variables, it's because implicit OUTPUT statement being executed at the end of the data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To create 100 empty (i.e. zero obs) data set use this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro create_empty_datasets;
    %do i = 1 %to 100;
        data WORK.ds_&amp;amp;i;
          STOP;
        run;
    %end;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and you will see that your query works ok.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 09:18:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-identify-empty-datasets-datasetnames-observartions-count/m-p/955001#M372978</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2025-01-03T09:18:41Z</dc:date>
    </item>
  </channel>
</rss>

