<?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 lock the entire hard drive procedure in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/lock-the-entire-hard-drive-procedure/m-p/697856#M213350</link>
    <description>&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="pl" data-phrase-index="0"&gt;&lt;SPAN&gt;Hi everyone.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="VIiyi"&gt; &lt;SPAN class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="pl" data-phrase-index="1"&gt;&lt;SPAN&gt;So far, I have used the following code to organize my access to files (one process blocked access to files, and another process where access was blocked tried to access the file in a loop).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro trylock(datasetIn =, timeout = 10, sleep = 1);
		%local starttime;       
		%let starttime = %sysfunc(datetime());       
		%do %until(&amp;amp;syslckrc &amp;lt;= 0           
			or %sysevalf(%sysfunc(datetime()) &amp;gt; (&amp;amp;starttime + &amp;amp;timeout)));          
		%put trying open ...;          
			data _null_;             
			dsid = 0;             
			do until (dsid &amp;gt; 0 or datetime() &amp;gt; (&amp;amp;starttime + &amp;amp;timeout));                
			dsid = open("&amp;amp;datasetIn");                
			if (dsid = 0) then rc = sleep(&amp;amp;sleep);             
			end;             
			if (dsid &amp;gt; 0) then rc = close(dsid);          
			run;          
		%put trying lock ...;          
	lock &amp;amp;datasetIn;          
		%put syslckrc = &amp;amp;syslckrc;       
		%end;    
%mend trylock; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="pl" data-phrase-index="2"&gt;&lt;SPAN&gt;Due to the large amount of data I had to buy another hard drive (WD4003FFBX) and you know what it is like with ordinary hdd disks, if several processes try to download data from one disk at the same time, the performance drops drastically.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="pl" data-phrase-index="3"&gt;&lt;SPAN&gt;Is there any procedure that would block access to the entire disk for only one process ??&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="pl" data-phrase-index="5"&gt;&lt;SPAN&gt;Thank you in advance for your help.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="VIiyi"&gt; &lt;SPAN class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="pl" data-phrase-index="7"&gt;&lt;SPAN&gt;Best wishes.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Nov 2020 11:35:33 GMT</pubDate>
    <dc:creator>makset</dc:creator>
    <dc:date>2020-11-10T11:35:33Z</dc:date>
    <item>
      <title>lock the entire hard drive procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/lock-the-entire-hard-drive-procedure/m-p/697856#M213350</link>
      <description>&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="pl" data-phrase-index="0"&gt;&lt;SPAN&gt;Hi everyone.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="VIiyi"&gt; &lt;SPAN class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="pl" data-phrase-index="1"&gt;&lt;SPAN&gt;So far, I have used the following code to organize my access to files (one process blocked access to files, and another process where access was blocked tried to access the file in a loop).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro trylock(datasetIn =, timeout = 10, sleep = 1);
		%local starttime;       
		%let starttime = %sysfunc(datetime());       
		%do %until(&amp;amp;syslckrc &amp;lt;= 0           
			or %sysevalf(%sysfunc(datetime()) &amp;gt; (&amp;amp;starttime + &amp;amp;timeout)));          
		%put trying open ...;          
			data _null_;             
			dsid = 0;             
			do until (dsid &amp;gt; 0 or datetime() &amp;gt; (&amp;amp;starttime + &amp;amp;timeout));                
			dsid = open("&amp;amp;datasetIn");                
			if (dsid = 0) then rc = sleep(&amp;amp;sleep);             
			end;             
			if (dsid &amp;gt; 0) then rc = close(dsid);          
			run;          
		%put trying lock ...;          
	lock &amp;amp;datasetIn;          
		%put syslckrc = &amp;amp;syslckrc;       
		%end;    
%mend trylock; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="pl" data-phrase-index="2"&gt;&lt;SPAN&gt;Due to the large amount of data I had to buy another hard drive (WD4003FFBX) and you know what it is like with ordinary hdd disks, if several processes try to download data from one disk at the same time, the performance drops drastically.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="pl" data-phrase-index="3"&gt;&lt;SPAN&gt;Is there any procedure that would block access to the entire disk for only one process ??&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="pl" data-phrase-index="5"&gt;&lt;SPAN&gt;Thank you in advance for your help.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="VIiyi"&gt; &lt;SPAN class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="pl" data-phrase-index="7"&gt;&lt;SPAN&gt;Best wishes.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 11:35:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/lock-the-entire-hard-drive-procedure/m-p/697856#M213350</guid>
      <dc:creator>makset</dc:creator>
      <dc:date>2020-11-10T11:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: lock the entire hard drive procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/lock-the-entire-hard-drive-procedure/m-p/697859#M213353</link>
      <description>&lt;UL&gt;
&lt;LI&gt;replace spinning metal with state of the art (SSD)&lt;/LI&gt;
&lt;LI&gt;organize your processes, so they run in sequence&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 10 Nov 2020 11:46:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/lock-the-entire-hard-drive-procedure/m-p/697859#M213353</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-10T11:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: lock the entire hard drive procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/lock-the-entire-hard-drive-procedure/m-p/697867#M213360</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;UL&gt;
&lt;LI&gt;replace spinning metal with state of the art (SSD)&lt;/LI&gt;
&lt;/UL&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;UL&gt;
&lt;LI&gt;organize your processes, so they run in sequence&lt;/LI&gt;
&lt;/UL&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="pl" data-phrase-index="0"&gt;&lt;SPAN&gt;It would cost me too much work and the effect would be unsatisfactory.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 12:00:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/lock-the-entire-hard-drive-procedure/m-p/697867#M213360</guid>
      <dc:creator>makset</dc:creator>
      <dc:date>2020-11-10T12:00:39Z</dc:date>
    </item>
  </channel>
</rss>

