<?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: SAS locks dataset for no reason in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760705#M240560</link>
    <description>It could be in the rest of your code. Without the full code and log not sure we can actually answer this.</description>
    <pubDate>Tue, 10 Aug 2021 16:42:41 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-08-10T16:42:41Z</dc:date>
    <item>
      <title>SAS locks dataset for no reason</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760621#M240524</link>
      <description>&lt;P&gt;I am trying to do a bootstrap sample of variables in a macro do loop. The code is similar to the macro shown below (NOTE: the code below works fine. It is the real dataset, which I cannot share here, where the problem occurs):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Macro test();
	%Do x = 1 %to 10;
		data cars;
		set sashelp.cars;
		run;

		Proc surveyselect
		Data=cars
		Method=urs
		Seed=90
		Samprate=0.5
		Reps=100
		Out=cars_sample;
		Run;

	/*Do something with the sample for each iteration*/
	%End;
%Mend;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;On the second iteration SAS tell me that the dataset is locked:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: You cannot open WORK.CARS_SAMPLE.DATA for output access with member-level control because WORK.CARS_SAMPLE.DATA is in use 
by you in resource environment IOM ROOT COMP ENV.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The dataset is certainly not open by any other user (this is confirmed because when I close SAS and start the session again the dataset unlocks), neither is it open by me in any other program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I solve this issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 13:00:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760621#M240524</guid>
      <dc:creator>kashlik123</dc:creator>
      <dc:date>2021-08-10T13:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS locks dataset for no reason</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760661#M240538</link>
      <description>&lt;P&gt;Set Enterprise Guide to not automatically open result datasets for viewing.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 13:58:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760661#M240538</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-10T13:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS locks dataset for no reason</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760665#M240541</link>
      <description>&lt;P&gt;Do you mean tools - options - data general - Automatically import data when added to project? Or something else?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 14:08:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760665#M240541</guid>
      <dc:creator>kashlik123</dc:creator>
      <dc:date>2021-08-10T14:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS locks dataset for no reason</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760673#M240547</link>
      <description>&lt;P&gt;&amp;nbsp;It is in Tools - Options - Results General - automatically open Data or Results (rough translation, my EG 7.15 is set to German)&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 14:39:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760673#M240547</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-10T14:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS locks dataset for no reason</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760680#M240548</link>
      <description>&lt;P&gt;My version is 8.1 and there is no such option&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kashlik123_0-1628606773580.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62453i075E22B176305E81/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kashlik123_0-1628606773580.png" alt="kashlik123_0-1628606773580.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 14:47:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760680#M240548</guid>
      <dc:creator>kashlik123</dc:creator>
      <dc:date>2021-08-10T14:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS locks dataset for no reason</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760684#M240549</link>
      <description>&lt;P&gt;If you are using EG 8, it would look something like the below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1628607340759.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62454i9742AE2F2738B2D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="jimbarbour_0-1628607340759.png" alt="jimbarbour_0-1628607340759.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 14:55:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760684#M240549</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-10T14:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAS locks dataset for no reason</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760702#M240557</link>
      <description>&lt;P&gt;Thank for the reply, but unfortunately it does not work&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 16:20:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760702#M240557</guid>
      <dc:creator>kashlik123</dc:creator>
      <dc:date>2021-08-10T16:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS locks dataset for no reason</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760705#M240560</link>
      <description>It could be in the rest of your code. Without the full code and log not sure we can actually answer this.</description>
      <pubDate>Tue, 10 Aug 2021 16:42:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760705#M240560</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-10T16:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: SAS locks dataset for no reason</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760706#M240561</link>
      <description>And make sure to restart EG between the change and test.</description>
      <pubDate>Tue, 10 Aug 2021 16:43:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760706#M240561</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-10T16:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS locks dataset for no reason</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760709#M240564</link>
      <description>&lt;P&gt;Try making a different dataset each time through the loop.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%do x = 1 %to 10;
...
  Out=cars_sample&amp;amp;x
...&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Aug 2021 17:35:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760709#M240564</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-08-10T17:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS locks dataset for no reason</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760713#M240566</link>
      <description>&lt;P&gt;An aside, when you use a specific seed value in Proc Surveyselect with the same input data set and other options/parameters the resulting data is exactly the same. So running that particular Surveyselect code generates the same data set 10 times.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know you are saying "like this" but if the code is close enough to the example there is a certain amount of repeating the same thing for the exact same sample.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And the likely issue is in the&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;/*Do something with the sample for each iteration*/&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Possibly one of the procedures like Proc Datasets or Document that expects a Quit statement to end the procedure.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 17:46:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-locks-dataset-for-no-reason/m-p/760713#M240566</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-10T17:46:48Z</dc:date>
    </item>
  </channel>
</rss>

