<?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 code when minutes is 0,5,10... in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Run-code-when-minutes-is-0-5-10/m-p/880574#M347923</link>
    <description>&lt;P&gt;What OS do your SAS sessions run on? The &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p0a6vn2td7bjr2n1viy8y4lgvq61.htm" target="_blank" rel="noopener"&gt;SLEEP function&lt;/A&gt; or the Windows-only &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostwin/n0t1al6tsabh54n0z50z5nl635cz.htm" target="_blank" rel="noopener"&gt;WAKEUP function&lt;/A&gt; are likely to be useful here. How long does your repeating code run for? I'd suggest using a DO loop, using the SLEEP function to pause between loops.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jun 2023 03:07:41 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2023-06-14T03:07:41Z</dc:date>
    <item>
      <title>Run code when minutes is 0,5,10...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-code-when-minutes-is-0-5-10/m-p/880564#M347917</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Inside a macro (which run every minutes),&amp;nbsp;&lt;/SPAN&gt;I want to run a code only when minutes = 0,5,10...45,50,55.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I can get away with the OR statement as below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However, I would like to know if there is any "cooler" way to get it don?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;HHC&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro time ();
	data _null_;
   	call symput('hh', hour(time()));
   	call symput('mm', minute(time()));
	run;
%if &amp;amp;mm =2 or &amp;amp;mm =5 or &amp;amp;mm =10 or &amp;amp;mm = 15 %then %do;&lt;BR /&gt;
	%put &amp;amp;mm.;
%end;
%mend;

%time ();&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Jun 2023 00:04:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-code-when-minutes-is-0-5-10/m-p/880564#M347917</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2023-06-14T00:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Run code when minutes is 0,5,10...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-code-when-minutes-is-0-5-10/m-p/880574#M347923</link>
      <description>&lt;P&gt;What OS do your SAS sessions run on? The &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p0a6vn2td7bjr2n1viy8y4lgvq61.htm" target="_blank" rel="noopener"&gt;SLEEP function&lt;/A&gt; or the Windows-only &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostwin/n0t1al6tsabh54n0z50z5nl635cz.htm" target="_blank" rel="noopener"&gt;WAKEUP function&lt;/A&gt; are likely to be useful here. How long does your repeating code run for? I'd suggest using a DO loop, using the SLEEP function to pause between loops.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 03:07:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-code-when-minutes-is-0-5-10/m-p/880574#M347923</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-06-14T03:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Run code when minutes is 0,5,10...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-code-when-minutes-is-0-5-10/m-p/880583#M347926</link>
      <description>&lt;P&gt;Put your code in a batch program and use the system's scheduler (e.g. &lt;A href="https://en.m.wikipedia.org/wiki/Cron" target="_blank" rel="noopener"&gt;cron&lt;/A&gt; on UNIX).&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 06:22:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-code-when-minutes-is-0-5-10/m-p/880583#M347926</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-06-14T06:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Run code when minutes is 0,5,10...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-code-when-minutes-is-0-5-10/m-p/880732#M347987</link>
      <description>&lt;P&gt;The problem is that my outer macro is already use the sleep function.&lt;/P&gt;
&lt;P&gt;So I can't do sleep for the inner code.&lt;/P&gt;
&lt;P&gt;Anyway, I do it the long way.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you all for helping&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let mm = %sysfunc(minute(%sysfunc(time())));

%IF &amp;amp;mm=0 or &amp;amp;mm=5 or &amp;amp;mm=10 or &amp;amp;mm= 15 or &amp;amp;mm=20 or &amp;amp;mm=25 or &amp;amp;mm=30 or &amp;amp;mm=35 or &amp;amp;mm=40 or &amp;amp;mm=45 or &amp;amp;mm=50 or &amp;amp;mm=55
%THEN %DO;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Jun 2023 15:59:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-code-when-minutes-is-0-5-10/m-p/880732#M347987</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2023-06-14T15:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Run code when minutes is 0,5,10...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-code-when-minutes-is-0-5-10/m-p/880733#M347988</link>
      <description>Use IN with MINOPERATOR option? &lt;BR /&gt;&lt;A href="https://www.9to5sas.com/in-operator-sas-macro/" target="_blank"&gt;https://www.9to5sas.com/in-operator-sas-macro/&lt;/A&gt;</description>
      <pubDate>Wed, 14 Jun 2023 16:09:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-code-when-minutes-is-0-5-10/m-p/880733#M347988</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-06-14T16:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Run code when minutes is 0,5,10...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-code-when-minutes-is-0-5-10/m-p/880734#M347989</link>
      <description>&lt;P&gt;Or do a calculation with SYSFUNC and MOD?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test(mm=);

%IF %sysfunc(mod(&amp;amp;mm, 5))= 0
%THEN %put mm=&amp;amp;mm;

%mend;

%test(mm=0);
%test(mm=6);
%test(mm=10);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Jun 2023 16:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-code-when-minutes-is-0-5-10/m-p/880734#M347989</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-06-14T16:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Run code when minutes is 0,5,10...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-code-when-minutes-is-0-5-10/m-p/881160#M348180</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;
&lt;P&gt;It is exactly what I am looking for.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 18:11:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-code-when-minutes-is-0-5-10/m-p/881160#M348180</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2023-06-16T18:11:02Z</dc:date>
    </item>
  </channel>
</rss>

