<?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 Print Number of Observations From A List of Tables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Print-Number-of-Observations-From-A-List-of-Tables/m-p/718654#M222435</link>
    <description>&lt;P&gt;I am looking to print the number of observations from a list of SAS tables.&amp;nbsp; I do NOT want them printed to the SAS log; I would like it as output from my code as either a SAS table or a report/summary.&amp;nbsp; I am avoiding using a proc sql count(# of obs) as I have several tables that are millions of rows long and that will be less efficient.&amp;nbsp; I would like the output to be the table name and then the number of observations in that table. An example is below.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Table Name&lt;/TD&gt;&lt;TD&gt;Number of Observations&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;WORK.CLAIMS1&lt;/TD&gt;&lt;TD&gt;20,000,000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;WORK.CLAIMS2&lt;/TD&gt;&lt;TD&gt;20,000,000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;WORK.CLAIMS3&lt;/TD&gt;&lt;TD&gt;25,000,000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Thu, 11 Feb 2021 16:28:23 GMT</pubDate>
    <dc:creator>Philmingo</dc:creator>
    <dc:date>2021-02-11T16:28:23Z</dc:date>
    <item>
      <title>Print Number of Observations From A List of Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Print-Number-of-Observations-From-A-List-of-Tables/m-p/718654#M222435</link>
      <description>&lt;P&gt;I am looking to print the number of observations from a list of SAS tables.&amp;nbsp; I do NOT want them printed to the SAS log; I would like it as output from my code as either a SAS table or a report/summary.&amp;nbsp; I am avoiding using a proc sql count(# of obs) as I have several tables that are millions of rows long and that will be less efficient.&amp;nbsp; I would like the output to be the table name and then the number of observations in that table. An example is below.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Table Name&lt;/TD&gt;&lt;TD&gt;Number of Observations&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;WORK.CLAIMS1&lt;/TD&gt;&lt;TD&gt;20,000,000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;WORK.CLAIMS2&lt;/TD&gt;&lt;TD&gt;20,000,000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;WORK.CLAIMS3&lt;/TD&gt;&lt;TD&gt;25,000,000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 11 Feb 2021 16:28:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Print-Number-of-Observations-From-A-List-of-Tables/m-p/718654#M222435</guid>
      <dc:creator>Philmingo</dc:creator>
      <dc:date>2021-02-11T16:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Print Number of Observations From A List of Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Print-Number-of-Observations-From-A-List-of-Tables/m-p/718658#M222438</link>
      <description>&lt;P&gt;Query the SAS table, sashelp.vtable which contains all tables and the number of records. This assumes your are not using a linked database table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table record_counts as
select  libname, memname, nobs
from sashelp.vtable
where libname='WORK' and upper(memname) like 'CLAIMS%';
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you also check out the knowledge base on here, people have posted some good references for creating metadata and codebooks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 16:34:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Print-Number-of-Observations-From-A-List-of-Tables/m-p/718658#M222438</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-02-11T16:34:59Z</dc:date>
    </item>
  </channel>
</rss>

