<?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: Run SAS program IF permanent table wa not updated today in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Run-SAS-program-IF-permanent-table-wa-not-updated-today/m-p/984540#M379708</link>
    <description>&lt;P&gt;I found following solution&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select datepart(modate)
into :last_update
from dictionary.tables
where libname='R_R'
and memname='CARS';
quit;

%put &amp;amp;=last_update;

%macro run_if_needed;
%if &amp;amp;last_update ne %sysfunc(today()) %then %do;
%put Table not updated today - program will run;
/* your program here */
%end;
%else %do;
%put Table already updated today - program will NOT run;
%end;

%mend &lt;CODE class="language-sas"&gt;run_if_needed&lt;/CODE&gt;; %run_if_needed; &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 10 Mar 2026 12:52:10 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2026-03-10T12:52:10Z</dc:date>
    <item>
      <title>Run SAS program IF permanent table wa not updated today</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-SAS-program-IF-permanent-table-wa-not-updated-today/m-p/984536#M379706</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I have the following problem-&lt;/P&gt;
&lt;P&gt;I want to&amp;nbsp; run sas code that will run in following way-&lt;/P&gt;
&lt;P&gt;If permanent table r_r.cars was lastly updated Today (Day of running=Day of last update of table) then program will not run.&lt;/P&gt;
&lt;P&gt;Else (If permanent table r_r.cars was lastly updated&amp;nbsp; before today) then program will run.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;What is the way to do it please?&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 11:41:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-SAS-program-IF-permanent-table-wa-not-updated-today/m-p/984536#M379706</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2026-03-10T11:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Run SAS program IF permanent table wa not updated today</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-SAS-program-IF-permanent-table-wa-not-updated-today/m-p/984538#M379707</link>
      <description>&lt;P&gt;You could try something like the following:&lt;/P&gt;
&lt;P&gt;%macro drive(dsn); &lt;BR /&gt;%let dsid = %sysfunc(open(&amp;amp;dsn)); &lt;BR /&gt;%let last_mod = %sysfunc(datepart(%sysfunc(attrn(&amp;amp;dsid, modte)))); &lt;BR /&gt;%let today=%sysfunc(today()); &lt;BR /&gt;%let rc = %sysfunc(close(&amp;amp;dsid)); &lt;BR /&gt;&lt;BR /&gt;%if &amp;amp;today ne &amp;amp;last_mod %then %do; &lt;BR /&gt;%include 'place file here that contains program to run'; &lt;BR /&gt;%end; &lt;BR /&gt;%else %put updated date for &amp;amp;dsn matches todays date of %sysfunc(putn(&amp;amp;today,date9.)); &lt;BR /&gt;%mend drive; &lt;BR /&gt;&lt;BR /&gt;%drive(r_r.cars) &lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 12:05:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-SAS-program-IF-permanent-table-wa-not-updated-today/m-p/984538#M379707</guid>
      <dc:creator>russt_sas</dc:creator>
      <dc:date>2026-03-10T12:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Run SAS program IF permanent table wa not updated today</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-SAS-program-IF-permanent-table-wa-not-updated-today/m-p/984540#M379708</link>
      <description>&lt;P&gt;I found following solution&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select datepart(modate)
into :last_update
from dictionary.tables
where libname='R_R'
and memname='CARS';
quit;

%put &amp;amp;=last_update;

%macro run_if_needed;
%if &amp;amp;last_update ne %sysfunc(today()) %then %do;
%put Table not updated today - program will run;
/* your program here */
%end;
%else %do;
%put Table already updated today - program will NOT run;
%end;

%mend &lt;CODE class="language-sas"&gt;run_if_needed&lt;/CODE&gt;; %run_if_needed; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Mar 2026 12:52:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-SAS-program-IF-permanent-table-wa-not-updated-today/m-p/984540#M379708</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2026-03-10T12:52:10Z</dc:date>
    </item>
  </channel>
</rss>

