<?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: How to run sas job again if table has not updated? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561048#M157005</link>
    <description>&lt;P&gt;Keep a table of dates (or datetimes) for which your code has run.&lt;/P&gt;
&lt;P&gt;Check the max date value of the Oracle table against the max date in your check table.&lt;/P&gt;
&lt;P&gt;If same, do nothing.&lt;/P&gt;
&lt;P&gt;If Oracle table max is greater than your check max, run your code, and add the new max to your check table.&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2019 06:00:50 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-05-23T06:00:50Z</dc:date>
    <item>
      <title>How to run sas job again if table has not updated?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/560966#M156961</link>
      <description>&lt;P&gt;Hello Friend, i have question related to my previous post but its kind of different. Please help...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I developed a code which&amp;nbsp;&lt;/P&gt;&lt;P&gt;first - going to check&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if oracle date has today's date and if yes - then&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;process the code and send email once output is ready&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; send email that oracle table has not updated and sas is not going to process further.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;now,&amp;nbsp; my question is. how can i run same job again if oracle table has not updated?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;i am going to schedule this one on cron. idea is run jobs, lets say every five minute and check if oracle table has updated or not. if updated, run process (as mentioned above) and if not check again in 5 minutes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now, i cannot schedule this job in cron every five minute because what if first run find correct date and processed already and 2nd run is going to find same thing and run it again. goal is also to avoid any manual intervention and run job when data table has updated, if not updated check back in like 5 minutes...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*code*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;%macro test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp;data _null_;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; call symputx('tday',put(today(),date9.));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; %put &amp;amp;tday;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp;LIBNAME testlib ORACLE USER=xyz PASSWORD="xyz" PATH='whatever' SCHEMA=xyz;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp;data check_date;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp;/*align date and format it*/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; proc sql noprint;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; /*find out max date and macrovariable */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; quit;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; %put &amp;amp;maxdate;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;%if &amp;amp;maxdate.=&amp;amp;tday. %then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%do;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;data _null_;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;filename mymail email "email"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;subject=" ";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;data _null_;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;file mymail;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; put "table updated, process further";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;data test1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set sashelp.stocks;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; proc export data=test1 outfile='/path_to_outputfile/testfile.txt' dbms=tab replace;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; putnames=no;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%let testfile1='/path_to_outputfile/testfile.txt';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %if %sysfunc(fileexist(&amp;amp;testfile1))&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %do;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;filename mymail email "email"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; subject=" ";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data _null_;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file mymail;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; put "output files available";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%end;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %do;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; filename mymail email "email"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; subject=" ";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data _null_;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file mymail;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; put "file are not available,check log";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%end;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %end;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %do;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;filename mymail email "email"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; subject=" ";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;data _null_;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;file mymail;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;put "table has not updated yet";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%end;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;%mend;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;%test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 21:39:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/560966#M156961</guid>
      <dc:creator>sampsas</dc:creator>
      <dc:date>2019-05-22T21:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas job again if table has not updated?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/560976#M156966</link>
      <description>&lt;P&gt;1) the best solution is to keep a control table that adds record to it every time the process runs. So the first time the code runs it will add a record for current date, in your program check if a record exists for current date and if it does the do %RETURN &amp;nbsp;else let it proceed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Other options&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) &amp;nbsp;IF the output a sas dataset - if so Lock the table and add the check in your IF condition to check if table is not locked only then proceed. (assuming you are appending data to an existing table). So next time cron job submits the sas code it will fail if its already running.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;2) &amp;nbsp;have a control table taht keeps a flag indicating the process has started and have that checked. and the end of the process update it so next code sub knows whether any process is currently running or not.&lt;BR /&gt;&lt;BR /&gt;3) create a temp file at start of process and delete it at end of process. Each new code sub should check if that file exists, if it does then %RETURN else proceed.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 21:08:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/560976#M156966</guid>
      <dc:creator>smijoss1</dc:creator>
      <dc:date>2019-05-22T21:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas job again if table has not updated?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/560979#M156969</link>
      <description>&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am sorry but i am not excellent programmer yet &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; - if someone can please help with control table logic (i included my code logic in my question for ref). if i go with option 1) do i still have to schedule job on cron multiple times? like every 5 minutes for 1 hour?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am thinking of schedule cron jobs just once for this sas program and let SAS keep checking for date, if today's date is there in table, process rest of the code, and if not, sleep for lets say 5 minutes and run check again?&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 21:47:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/560979#M156969</guid>
      <dc:creator>sampsas</dc:creator>
      <dc:date>2019-05-22T21:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas job again if table has not updated?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561014#M156987</link>
      <description>&lt;P&gt;Your code is very hard to read.&lt;/P&gt;
&lt;P&gt;Consider some code-writing practices that will make it more legible, like the ones used below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We don't know exactly what you want, but I suspect the code below will be close to what you need.&lt;/P&gt;
&lt;P&gt;Modify as required.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%macro test;

  filename OUTFILE '/path_to_outputfile/testfile.txt';

  data _null_;
    call symputx('tday'  ,put(today(),date9.));
    call symputx('crdate',' '                );
    if fexist('OUTFILE');
    FID=fopen('OUTFILE');                                                                                                                 
    CRDATE=input(finfo(FID,'Create Time'),anydtdtm.);
    FID=fclose(FID);                                                                                                                 
    call symputx('crdate',put(CRDATE,datetime9.));
  run;

  %put &amp;amp;=tday &amp;amp;=crdate;

  %if &amp;amp;crdate. = &amp;amp;tday. %then %do;
    data _null_;
      file mymail email ;
      put '!em_subject! Job status';
      put '!em_to!      email@address';
      put "output file already available ";
    run;
    %return;
  %end;

  LIBNAME testlib ORACLE USER=xyz PASSWORD="xyz" PATH='whatever' SCHEMA=xyz;

  data check_date;
  /*align date and format it*/
  run;

  proc sql noprint;
  /*find out max date and macrovariable */
  quit;

  %put &amp;amp;maxdate;


  %if &amp;amp;maxdate. ne &amp;amp;tday. %then %do;
    data _null_;
      file mymail email ;
      put '!em_subject! Job status';
      put '!em_to!      email@address';
      put "table has not updated yet";
    run;
    %return;
  %end;

  data _null_;
    file mymail email  ;
    put '!em_subject! Job status';
    put '!em_to!      email@address';
    put "table updated, process further";
  run;

  data test1;
    set sashelp.stocks;
  run;

  proc export data=test1 outfile=OUTFILE dbms=tab replace;
    putnames=no;
  run;

  data _null_;
    file mymail email  ;
    put '!em_subject! Job status';
    put '!em_to!      email@address';
    if fexist(OUTFILE) then do;
      put "output files available";
    end;
    else do;
      put "file are not available,check log";
    end;
  run;

  filename OUTFILE clear;

 %mend;

 
%test;
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 01:59:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561014#M156987</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-05-23T01:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas job again if table has not updated?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561024#M156991</link>
      <description>&lt;P&gt;The issues I see with your approach (after a quick skim only):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) You're sending an email every 5 mins when the data hasn't been updated yet.&amp;nbsp; That would annoy me to get these "nothing" emails.&lt;/P&gt;
&lt;P&gt;2) You're launching SAS every 5 mins to check if the data has been updated.&amp;nbsp; That could be done using Oracle utilities (I think?) and avoid the overhead of launching SAS just to launch an Oracle query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is how I'd approach it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Write a bash script that would:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Launch an Oracle command line query to check if the data has been updated: max(date) &amp;gt;= today's date.&amp;nbsp; If so,&lt;/P&gt;
&lt;P&gt;2) Check a text file to see if the SAS program has run.&amp;nbsp; Use the tail -1 command to read the last line of the file.&amp;nbsp; If SAS has run, abort the script.&amp;nbsp; You could also check your logs directory for the appropriate timestamped log from your job - that would also work, but could be problematic if your program failed and should be re-run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(You could reverse #1 and #2 - whatever works best for you)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) Ok, so Oracle has updated and the SAS program hasn't run, so launch SAS.&lt;/P&gt;
&lt;P&gt;4) Run your program.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5) At the end of your program, check &amp;amp;syscc.&amp;nbsp; If there have been no errors, append a line to your text file log indicating your program has run.&lt;/P&gt;
&lt;P&gt;6) Send your email indicating success or failure of your program.&lt;/P&gt;
&lt;P&gt;7) Schedule your bash script to run every 5 mins.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; Your text file log is a quick check for you to see if you program has run successfully.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Much of this logic could be avoided if you have a more robust scheduler than cron.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are many ways to approach this - I'm sure others will suggest alternative approaches.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;i am sorry but i am not excellent programmer yet&amp;nbsp;&lt;/SPAN&gt;&lt;IMG class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" border="0" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;SPAN&gt;&amp;nbsp;- if someone can please help with control table logic&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a colleague who can assist?&amp;nbsp; Do you know shell scripting?&amp;nbsp; Do you know whatever command line utilities Oracle provides to execute a query and return the results to the calling script?&amp;nbsp; Do you know how SAS appends data to an external file?&amp;nbsp; If not, Google and the SAS doc are your friends.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 03:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561024#M156991</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-05-23T03:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas job again if table has not updated?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561025#M156992</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thing is we don't know when oracle table is going to update (do not have exact time) so we want to see if we can run sas job every five minute and if table gets updated run the job and finish else keep checking every five minutes.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 03:55:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561025#M156992</guid>
      <dc:creator>sampsas</dc:creator>
      <dc:date>2019-05-23T03:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas job again if table has not updated?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561028#M156993</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209167"&gt;@sampsas&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thing is we don't know when oracle table is going to update (do not have exact time) so we want to see if we can run sas job every five minute and if table gets updated run the job and finish else keep checking every five minutes.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you understand&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;'s code?&amp;nbsp; His code addresses your comment above.&amp;nbsp; You just need to schedule it every 5 mins.&amp;nbsp; And you may have to modify it - with your generic description of your problem, it is impossible to spoon feed you perfectly working code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a start, why don't you hit the SAS doc for every command and function Chris listed in his code?&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 04:04:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561028#M156993</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-05-23T04:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas job again if table has not updated?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561038#M156999</link>
      <description>&lt;P&gt;I agree with Scott that it does not look like you much spent time looking at the solution I am proposing.&lt;/P&gt;
&lt;P&gt;Regarding scheduling, if you want to do this in SAS, you could run something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  do until (datepart(CRDATE)=today());
    rc= dosubl('%test');                              
    if ^fexist('OUTFILE') then call sleep(300,1);
    else do;
      FID=fopen('OUTFILE');                                                                                                                 
      CRDATE=input(finfo(FID,'Create Time'),anydtdtm.);
      FID=fclose(FID);                                                                                                                 
      if ^(datepart(CRDATE)=today()) then call sleep(300,1);
    end;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The filename must now be outside of the macro.&lt;/P&gt;
&lt;P&gt;The macro can be simplified since some of the vetting now takes place here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 04:36:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561038#M156999</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-05-23T04:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas job again if table has not updated?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561048#M157005</link>
      <description>&lt;P&gt;Keep a table of dates (or datetimes) for which your code has run.&lt;/P&gt;
&lt;P&gt;Check the max date value of the Oracle table against the max date in your check table.&lt;/P&gt;
&lt;P&gt;If same, do nothing.&lt;/P&gt;
&lt;P&gt;If Oracle table max is greater than your check max, run your code, and add the new max to your check table.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 06:00:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561048#M157005</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-05-23T06:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas job again if table has not updated?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561189#M157053</link>
      <description>&lt;P&gt;Thank you all and really appreciate your time. and i am really sorry but i don't need line by line code from you. Trying to understand logic and to see where exactly i can insert your suggestion in my existing code. i never implemented such logic so hard for me to understand your input you are providing. i will be extra careful when asking question next time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;just have one question if you can answer, if i go with below option, what is "outfile" in your code? (because, i don't receive any touch file when oracle table gets updated, i will have to keep checking against oracle table only)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; _null_&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  do until &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;datepart&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;CRDATE&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;today&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
    rc&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; dosubl&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'%test'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;                              
    &lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;^&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;fexist&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'OUTFILE'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; call &lt;SPAN class="token function"&gt;sleep&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;300&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="token keyword"&gt;else&lt;/SPAN&gt; do&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
      FID&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;fopen&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'OUTFILE'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;                                                                                                                 
      CRDATE&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;finfo&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;FID&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'Create Time'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;anydtdtm&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
      FID&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;fclose&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;FID&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;                                                                                                                 
      &lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;^&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;datepart&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;CRDATE&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;today&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; call &lt;SPAN class="token function"&gt;sleep&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;300&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
    end&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  end&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 15:43:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561189#M157053</guid>
      <dc:creator>sampsas</dc:creator>
      <dc:date>2019-05-23T15:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas job again if table has not updated?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561247#M157082</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;what is "outfile" in your code?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The answer is in this element of my reply, which you seem to have missed:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;The filename must now be outside of the macro.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This data step checks the creation date for the file and waits if it's not today or if there is no file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 21:37:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561247#M157082</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-05-23T21:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas job again if table has not updated?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561509#M157208</link>
      <description>&lt;P&gt;How do you ensure you code isnt triggered when the load is still happening ? (Unless its very small data and the load is instant i would worry about the process picking partial data.&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 19:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561509#M157208</guid>
      <dc:creator>smijoss1</dc:creator>
      <dc:date>2019-05-24T19:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas job again if table has not updated?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561510#M157209</link>
      <description>&lt;P&gt;WAIT &amp;nbsp;all you are doing is dumping the Oracle table into an Text file. For that you are downloading the Oracle table into SAS and then exporting. Too much data transfer if the Table is huge.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I would suggest using Oracle Script&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 19:05:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-job-again-if-table-has-not-updated/m-p/561510#M157209</guid>
      <dc:creator>smijoss1</dc:creator>
      <dc:date>2019-05-24T19:05:42Z</dc:date>
    </item>
  </channel>
</rss>

