<?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: Hold Lock for dataset for specified time in All Things Community</title>
    <link>https://communities.sas.com/t5/All-Things-Community/Hold-Lock-for-dataset-for-specified-time/m-p/367471#M2531</link>
    <description>&lt;P&gt;I would look into the sleep() function. It delays execution by the time specified.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is SAS's documentation on the function:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#p0a6vn2td7bjr2n1viy8y4lgvq61.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#p0a6vn2td7bjr2n1viy8y4lgvq61.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I quickly wrote up a crude macro that could be used for this. Perhaps there's a more creative&amp;nbsp;method, but this works.&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 to delay processing: 
Number: Amount of time to wait
Units: Unit of time to wait ("seconds", "minutes", "hours", "days") 
********************************************************************/

%macro waiting(number, units);
data wait;
  if &amp;amp;units. = "seconds" then unit = 1; *Base unit in sleep function;
  else if &amp;amp;units.="minutes" then unit=60; *60 seconds in a minute;
  else if &amp;amp;units.="hours" then unit=3600; *3,600 seconds in an hours (60 seconds per minute * 60 minutes per hour);
  else if &amp;amp;units.="days" then unit=86400; *86,400 seconds in a day (60 seconds per minute * 60 minutes per hour * 24 hours per day);
  wait_time = sleep(&amp;amp;number., unit);
  run;
%mend;

%waiting(number=10, units="minutes");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jun 2017 18:32:17 GMT</pubDate>
    <dc:creator>Rwon</dc:creator>
    <dc:date>2017-06-15T18:32:17Z</dc:date>
    <item>
      <title>Hold Lock for dataset for specified time</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Hold-Lock-for-dataset-for-specified-time/m-p/364469#M2516</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want hold Lock for specific dataset in specifed time period like in below program i have written lock statment and lock clear stament&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;want to run lock clear stament after specified time in windows(SAS EG) and unix&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is any wayt to hold the lock for specified time and when use the same dataset in menioned perios want get error as data set was locked by user&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data work.test01;&lt;BR /&gt;&amp;nbsp; input &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/46433"&gt;@01&lt;/a&gt; employee_id&amp;nbsp;&amp;nbsp; 6.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @08 last_name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $10.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/131792"&gt;@19&lt;/a&gt; birthday&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date7.;&lt;BR /&gt;&amp;nbsp; format employee_id&amp;nbsp;&amp;nbsp; 6.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; last_name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $10.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; birthday&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date7.;&lt;BR /&gt;&amp;nbsp; datalines;&lt;BR /&gt;&amp;nbsp; 1247 Garcia&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04APR54&lt;BR /&gt;&amp;nbsp; 1078 Gibson&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 23APR36&lt;BR /&gt;&amp;nbsp; 1005 Knapp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 06OCT38&lt;BR /&gt;&amp;nbsp; 1024 Mueller&amp;nbsp;&amp;nbsp;&amp;nbsp; 17JUN53 &lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;lock AccesChk.test01 ;&lt;BR /&gt;&lt;BR /&gt;/*wiat for 10 min after lock need to be clear*/&lt;BR /&gt;/*and mean while i will use this dataset for other program and i want get error */&lt;BR /&gt;/*as data set was locked by user*/&lt;BR /&gt;&lt;BR /&gt;/*is any options for holding some time in windoiws and unix ?*/&lt;BR /&gt;&lt;BR /&gt;lock AccesChk.test01 clear ;&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>Tue, 06 Jun 2017 05:50:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Hold-Lock-for-dataset-for-specified-time/m-p/364469#M2516</guid>
      <dc:creator>RajasekharReddy</dc:creator>
      <dc:date>2017-06-06T05:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Hold Lock for dataset for specified time</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Hold-Lock-for-dataset-for-specified-time/m-p/367471#M2531</link>
      <description>&lt;P&gt;I would look into the sleep() function. It delays execution by the time specified.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is SAS's documentation on the function:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#p0a6vn2td7bjr2n1viy8y4lgvq61.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#p0a6vn2td7bjr2n1viy8y4lgvq61.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I quickly wrote up a crude macro that could be used for this. Perhaps there's a more creative&amp;nbsp;method, but this works.&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 to delay processing: 
Number: Amount of time to wait
Units: Unit of time to wait ("seconds", "minutes", "hours", "days") 
********************************************************************/

%macro waiting(number, units);
data wait;
  if &amp;amp;units. = "seconds" then unit = 1; *Base unit in sleep function;
  else if &amp;amp;units.="minutes" then unit=60; *60 seconds in a minute;
  else if &amp;amp;units.="hours" then unit=3600; *3,600 seconds in an hours (60 seconds per minute * 60 minutes per hour);
  else if &amp;amp;units.="days" then unit=86400; *86,400 seconds in a day (60 seconds per minute * 60 minutes per hour * 24 hours per day);
  wait_time = sleep(&amp;amp;number., unit);
  run;
%mend;

%waiting(number=10, units="minutes");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 18:32:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Hold-Lock-for-dataset-for-specified-time/m-p/367471#M2531</guid>
      <dc:creator>Rwon</dc:creator>
      <dc:date>2017-06-15T18:32:17Z</dc:date>
    </item>
  </channel>
</rss>

