<?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: Wakeup Function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Wakeup-Function/m-p/374458#M89668</link>
    <description>&lt;P&gt;WAKEUP is a Windows-only feature of SAS.&lt;/P&gt;
&lt;P&gt;You won't find it in the generic SAS documentation of functions and call routines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To achieve something similar on any other platform, do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let sleep_until='10jul2017:14:30:00'dt;

data _null_;
sleeptime = &amp;amp;sleep_until - time();
slept = sleep(sleeptime);
run;&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;</description>
    <pubDate>Mon, 10 Jul 2017 12:14:26 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-07-10T12:14:26Z</dc:date>
    <item>
      <title>Wakeup Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wakeup-Function/m-p/374455#M89667</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Wakeup function seems unrecognized. The wakeup function allows you to specify the date and time to delay the execution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Indeed in my Windows machine it works but not working on my Linux Machine with SAS 9.4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;rc=wakeup(DHMS(TODAY(),&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;7&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;30&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR 68-185: The function WAKEUP is unknown, or cannot be accessed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 11:58:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wakeup-Function/m-p/374455#M89667</guid>
      <dc:creator>alexlor</dc:creator>
      <dc:date>2017-07-10T11:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Wakeup Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wakeup-Function/m-p/374458#M89668</link>
      <description>&lt;P&gt;WAKEUP is a Windows-only feature of SAS.&lt;/P&gt;
&lt;P&gt;You won't find it in the generic SAS documentation of functions and call routines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To achieve something similar on any other platform, do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let sleep_until='10jul2017:14:30:00'dt;

data _null_;
sleeptime = &amp;amp;sleep_until - time();
slept = sleep(sleeptime);
run;&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;</description>
      <pubDate>Mon, 10 Jul 2017 12:14:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wakeup-Function/m-p/374458#M89668</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-10T12:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Wakeup Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wakeup-Function/m-p/374472#M89672</link>
      <description>On Linux the default unit for sleep is miliseconds rather than seconds.  So could adjust &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;'s calculation to be:&lt;BR /&gt; sleeptime = (&amp;amp;sleep_until - time()) *1000 ;</description>
      <pubDate>Mon, 10 Jul 2017 12:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wakeup-Function/m-p/374472#M89672</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2017-07-10T12:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Wakeup Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wakeup-Function/m-p/374481#M89676</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt; you are right, of course. The proper way to use the sleep function is this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let sleep_until='10jul2017:14:30:00'dt;

data _null_;
sleeptime = &amp;amp;sleep_until - time();
slept = sleep(sleeptime,1);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;as this forces sleep() to use seconds as the unit across all platforms.&lt;/P&gt;
&lt;P&gt;Or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let sleep_until='10jul2017:14:30:00'dt;

data _null_;
sleeptime = &amp;amp;sleep_until - time();
call sleep(sleeptime,1);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Jul 2017 13:00:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wakeup-Function/m-p/374481#M89676</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-10T13:00:37Z</dc:date>
    </item>
  </channel>
</rss>

