<?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 Displaying total number of OBS in each Datasets in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-total-number-of-OBS-in-each-Datasets/m-p/8564#M2854</link>
    <description>Hi All... &lt;BR /&gt;
&lt;BR /&gt;
Just want to say thank you so much to Cynthia for your help! &lt;BR /&gt;
&lt;BR /&gt;
I am almost close to finishing my project.&lt;BR /&gt;
&lt;BR /&gt;
I have 15 Datasets at the moment and just wondering is there any Proc steps that I can use to display the total number of obs in each of thesedatasets. &lt;BR /&gt;
&lt;BR /&gt;
For example... Something like this... &lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Name of Dataset                    Number of Obs&lt;/B&gt;&lt;BR /&gt;
DatasetA                                      1002541&lt;BR /&gt;
DatasetB                                        599&lt;BR /&gt;
DatasetC                                       1400000&lt;BR /&gt;
DatasetD                                         256398&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance!!!&lt;BR /&gt;
Cheers.&lt;BR /&gt;
&lt;BR /&gt;
Yennie</description>
    <pubDate>Wed, 28 Oct 2009 04:29:34 GMT</pubDate>
    <dc:creator>Yennie</dc:creator>
    <dc:date>2009-10-28T04:29:34Z</dc:date>
    <item>
      <title>Displaying total number of OBS in each Datasets</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-total-number-of-OBS-in-each-Datasets/m-p/8564#M2854</link>
      <description>Hi All... &lt;BR /&gt;
&lt;BR /&gt;
Just want to say thank you so much to Cynthia for your help! &lt;BR /&gt;
&lt;BR /&gt;
I am almost close to finishing my project.&lt;BR /&gt;
&lt;BR /&gt;
I have 15 Datasets at the moment and just wondering is there any Proc steps that I can use to display the total number of obs in each of thesedatasets. &lt;BR /&gt;
&lt;BR /&gt;
For example... Something like this... &lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Name of Dataset                    Number of Obs&lt;/B&gt;&lt;BR /&gt;
DatasetA                                      1002541&lt;BR /&gt;
DatasetB                                        599&lt;BR /&gt;
DatasetC                                       1400000&lt;BR /&gt;
DatasetD                                         256398&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance!!!&lt;BR /&gt;
Cheers.&lt;BR /&gt;
&lt;BR /&gt;
Yennie</description>
      <pubDate>Wed, 28 Oct 2009 04:29:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-total-number-of-OBS-in-each-Datasets/m-p/8564#M2854</guid>
      <dc:creator>Yennie</dc:creator>
      <dc:date>2009-10-28T04:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying total number of OBS in each Datasets</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-total-number-of-OBS-in-each-Datasets/m-p/8565#M2855</link>
      <description>Hi:&lt;BR /&gt;
  Take a look at the "DICTIONARY" tables that you can query with PROC SQL or the SASHELP. Views that you can use with PROC PRINT or PROC REPORT.&lt;BR /&gt;
 &lt;BR /&gt;
  Documentation about using these tables to report on your dataset specific information can be found here:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/a001385596.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/a001385596.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
This documentation link contains an example that shows how to display a list of datasets and the number of observations.&lt;BR /&gt;
  &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 28 Oct 2009 06:48:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-total-number-of-OBS-in-each-Datasets/m-p/8565#M2855</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-10-28T06:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying total number of OBS in each Datasets</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-total-number-of-OBS-in-each-Datasets/m-p/8566#M2856</link>
      <description>Hi Cynthia, &lt;BR /&gt;
&lt;BR /&gt;
Thank you so much for your prompt reply. I tried the example which you gave me and this is my coding (which I did not change much at all) &lt;BR /&gt;
&lt;BR /&gt;
Proc SQL;&lt;BR /&gt;
Title "All Datasets and Views in Asset Risk Library";&lt;BR /&gt;
Select Libname, Memname, Memtype, Nobs&lt;BR /&gt;
From Dictionary.Tables&lt;BR /&gt;
Where Libname = 'SQL';&lt;BR /&gt;
&lt;BR /&gt;
However, Log gave me an error which says "NOTE: No rows were selected."&lt;BR /&gt;
&lt;BR /&gt;
Just wondering if you can help me out with this one here? Am I suppose to embed Dictionary.Table in my Library? &lt;BR /&gt;
&lt;BR /&gt;
Thanks In Advance!&lt;BR /&gt;
&lt;BR /&gt;
Yennie</description>
      <pubDate>Thu, 29 Oct 2009 00:03:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-total-number-of-OBS-in-each-Datasets/m-p/8566#M2856</guid>
      <dc:creator>Yennie</dc:creator>
      <dc:date>2009-10-29T00:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying total number of OBS in each Datasets</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-total-number-of-OBS-in-each-Datasets/m-p/8567#M2857</link>
      <description>Hi:&lt;BR /&gt;
  It's very likely that you don't have a permanent library assigned that is named 'SQL'. You have to at least know the name of a LIBRARY that you want to find out the information about. For example, you probably do have a SASHELP Library assigned. &lt;BR /&gt;
   &lt;BR /&gt;
  You could try this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
Proc SQL;&lt;BR /&gt;
  Title "All Datasets and Views in the SASHELP Library";&lt;BR /&gt;
  Select Libname, Memname, Memtype, Nobs&lt;BR /&gt;
  From Dictionary.Tables&lt;BR /&gt;
  Where Libname = 'SASHELP';&lt;BR /&gt;
quit;&lt;BR /&gt;
            &lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                     &lt;BR /&gt;
Next, you will need to figure out where your datasets of interest reside. Let's say that you have a bunch of SAS datasets stored in this physical location:&lt;BR /&gt;
c:\datafiles\accounting\&lt;BR /&gt;
 &lt;BR /&gt;
so you make a LIBNAME statement and change the code:&lt;BR /&gt;
[pre]&lt;BR /&gt;
LIBNAME  MYDATA 'C:\datafiles\accounting';&lt;BR /&gt;
                    &lt;BR /&gt;
Proc SQL;&lt;BR /&gt;
  Title "All Datasets and Views in the MYDATA Library";&lt;BR /&gt;
  Select Libname, Memname, Memtype, Nobs&lt;BR /&gt;
  From Dictionary.Tables&lt;BR /&gt;
  Where Libname = 'MYDATA';&lt;BR /&gt;
quit;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                                 &lt;BR /&gt;
Hope that helps. &lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 29 Oct 2009 04:49:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-total-number-of-OBS-in-each-Datasets/m-p/8567#M2857</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-10-29T04:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying total number of OBS in each Datasets</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-total-number-of-OBS-in-each-Datasets/m-p/8568#M2858</link>
      <description>Hey Cynthia! &lt;BR /&gt;
&lt;BR /&gt;
I made a mistake. It was a typo! My permanent library is known as "Arisk" therefore now the script works!!!&lt;BR /&gt;
&lt;BR /&gt;
Last Question: Just wondering, there are a total of 100 datasets in my libray however I am just wanting the query to display that 15 datasets that I want. do you know how to get around it? &lt;BR /&gt;
&lt;BR /&gt;
thank you so much for you help genius!! &lt;BR /&gt;
&lt;BR /&gt;
Cheers, &lt;BR /&gt;
Yennie</description>
      <pubDate>Thu, 29 Oct 2009 05:02:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-total-number-of-OBS-in-each-Datasets/m-p/8568#M2858</guid>
      <dc:creator>Yennie</dc:creator>
      <dc:date>2009-10-29T05:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying total number of OBS in each Datasets</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-total-number-of-OBS-in-each-Datasets/m-p/8569#M2859</link>
      <description>Hi:&lt;BR /&gt;
  Look at changing your WHERE clause to get only the list of datasets that you want -- using the MEMNAME variable:&lt;BR /&gt;
[pre]&lt;BR /&gt;
Proc SQL;&lt;BR /&gt;
  Title "All Datasets and Views in the SASHELP Library";&lt;BR /&gt;
  Select Libname, Memname, Memtype, Nobs&lt;BR /&gt;
  From Dictionary.Tables&lt;BR /&gt;
  Where Libname = 'SASHELP' and&lt;BR /&gt;
        memname in ('CLASS', 'SHOES', 'PRDSALE');&lt;BR /&gt;
quit;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
         &lt;BR /&gt;
...this code would list only the 3 datasets that meet the IN condition.&lt;BR /&gt;
 &lt;BR /&gt;
You can put as many dataset names as you want inside the parentheses for IN, do note that the values are expected to be in UPPER case and quoted.  PROC SQL uses standard WHERE clause operators, so if you can identify conditions with different logic, then go for it.&lt;BR /&gt;
           &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 29 Oct 2009 06:29:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-total-number-of-OBS-in-each-Datasets/m-p/8569#M2859</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-10-29T06:29:27Z</dc:date>
    </item>
  </channel>
</rss>

