<?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 Re: Sas grid in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Count-no-of-created-or-modified-datasets/m-p/965662#M375929</link>
    <description>&lt;P&gt;Assuming you have the GRP and CREDIT librefs already defined you can use PROC CONTENTS to get information about datasets and variables at the same time.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=grp._all_ noprint out=grp_contents; run;
proc contents data=credit._all_ noprint out=credit_contents; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can also query the DICTIONARY. (pseudo) tables from SQL code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want the tables names then filter.&amp;nbsp; So perhaps something like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table tables as 
select libname,memname,modate
from dictionary.tables 
where libname in ("GRP" "CREDIT") 
having intnx('dtmonth',modate,0)='01MAY2025:00:00'dt
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 03 May 2025 21:24:14 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2025-05-03T21:24:14Z</dc:date>
    <item>
      <title>Count no of created or modified datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-no-of-created-or-modified-datasets/m-p/965660#M375928</link>
      <description>&lt;P&gt;sas code which fetch all the dataset that are modified and created in may’25 and their count from grp/credit lib. Actually i want exact count of dataset that are created or modified in may month from grp/credit lib.&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 15:17:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-no-of-created-or-modified-datasets/m-p/965660#M375928</guid>
      <dc:creator>Sanjeevas</dc:creator>
      <dc:date>2025-05-06T15:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Sas grid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-no-of-created-or-modified-datasets/m-p/965662#M375929</link>
      <description>&lt;P&gt;Assuming you have the GRP and CREDIT librefs already defined you can use PROC CONTENTS to get information about datasets and variables at the same time.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=grp._all_ noprint out=grp_contents; run;
proc contents data=credit._all_ noprint out=credit_contents; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can also query the DICTIONARY. (pseudo) tables from SQL code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want the tables names then filter.&amp;nbsp; So perhaps something like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table tables as 
select libname,memname,modate
from dictionary.tables 
where libname in ("GRP" "CREDIT") 
having intnx('dtmonth',modate,0)='01MAY2025:00:00'dt
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 03 May 2025 21:24:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-no-of-created-or-modified-datasets/m-p/965662#M375929</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-05-03T21:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sas grid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-no-of-created-or-modified-datasets/m-p/965673#M375936</link>
      <description>Sorry this didn’t work as i want the count(*) of all datasets which are created or modified in may month ftom ”grp/credit/deployed” lib</description>
      <pubDate>Sun, 04 May 2025 03:15:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-no-of-created-or-modified-datasets/m-p/965673#M375936</guid>
      <dc:creator>Sanjeevas</dc:creator>
      <dc:date>2025-05-04T03:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: Sas grid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-no-of-created-or-modified-datasets/m-p/965675#M375937</link>
      <description>&lt;P&gt;Hello Sanjeevas,&lt;/P&gt;
&lt;P&gt;I think that Tom's idea is a better one in that it gives you a handy look-up list of dataset names from which you can &lt;EM&gt;then&lt;/EM&gt; get your COUNT(*) from. In my experience, once you know the number of datasets someone then asks you for more information about some of those datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, here are two other options for you to consider.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;************************************************************************;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;*Option 1 - Just create a report showing the number of datasets modified;
************************************************************************;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;Proc SQL;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt; Title "Number of Datasets that were Created/Modified in May 2025";&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt; Select Count(*) As Number_Of_Tables&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt; From   DICTIONARY.TABLES&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt; Where  Libname In ("GRP" "CREDIT", "DEPLOYED")&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;        And&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;        IntNx("dtmonth",MoDate,0)="01MAY2025:00:00"dt&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;        ;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;Quit;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;****************************************************************************;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;*Option 2 - Create a macro variable to hold the number of datasets modified.;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;****************************************************************************;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;CODE class=" language-sas"&gt;Proc SQL NoPrint;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt; Select Count(*) As Number_Of_Tables INTO :Modified_Count&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt; From   DICTIONARY.TABLES&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt; Where  Libname In ("GRP" "CREDIT", "DEPLOYED")&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;        And&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;        IntNx("dtmonth",MoDate,0)="01MAY2025:00:00"dt&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;        ;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;Quit;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;********************************************************************************;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;*Prove that our macro contains the number we expect by writing it to the SASLOG.;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;********************************************************************************;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;%Put Macro Variable Modified_Count resolves to: &amp;amp;Modified_Count;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;If you just want to know the number of modified datasets, &lt;EM&gt;either&lt;/EM&gt; of the above options should work for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, if you want the remainder of your code to take some action based on how many datasets were modified in May 2025, option 2 is better because you can use the macro variable&amp;nbsp;&lt;CODE class=" language-sas"&gt;&amp;amp;Modified_Count&lt;/CODE&gt; to drive things like a Do/End loop or to take decisions about whether to execute certain bits of code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would imagine that eventually you would need to know about the number of datasets modified in June, then July etc. If this is the case, macro variables and a tiny bit of macro code would really help you a lot.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the moment, I hope that this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Downunder Dave&lt;/P&gt;
&lt;P&gt;Wellington&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 May 2025 09:44:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-no-of-created-or-modified-datasets/m-p/965675#M375937</guid>
      <dc:creator>DaveShea</dc:creator>
      <dc:date>2025-05-04T09:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Sas grid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-no-of-created-or-modified-datasets/m-p/965681#M375938</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/411674"&gt;@Sanjeevas&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Sorry this didn’t work as i want the count(*) of all datasets which are created or modified in may month ftom ”grp/credit/deployed” lib&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why doesn't it work for you?&amp;nbsp; It works fine for me.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table tables as 
select libname,memname,modate,nlobs
from dictionary.tables 
where libname in ("GRP" "CREDIT" "DEPLOYED") 
having intnx('dtmonth',modate,0)='01MAY2025:00:00'dt
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Are they not actually SAS datasets?&amp;nbsp; If they are views then you will have to actually count the observations manually.&amp;nbsp; And I have not idea how to determine if the number of observations that a view returns has changed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 May 2025 14:43:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-no-of-created-or-modified-datasets/m-p/965681#M375938</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-05-04T14:43:12Z</dc:date>
    </item>
  </channel>
</rss>

