<?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: WORK library authorization error when PROC SURVEYMEANS runs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/WORK-library-authorization-error-when-PROC-SURVEYMEANS-runs/m-p/965437#M375849</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/465981"&gt;@eiger&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm running SAS 9.4 on Windows. I have a loop that subsets the data, then runs proc surveymeans for the subset of data. The original code is shown below.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You should read the section in the online help in the syntax section of the BY statement about subsetting the data in the survey procs, such as you are doing, does not yield valid subpopulation analysis.&lt;/P&gt;
&lt;P&gt;With Surveymeans the appropriate approach would be to add the subsetting variable(s) to the DOMAIN statement and then select the values as needed for your reports. You can have more than one variable on the Domain statement. The order of the variables does affect the order of the output data sets so may want to experiment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that adding your IMPLIC variable to the Domain statement would also mean no Macro loop is needed. The syntax to get levels of Implic with each level of Igroup would be :&lt;/P&gt;
&lt;P&gt;Domain Igroup * Implic ; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Apr 2025 16:36:00 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2025-04-30T16:36:00Z</dc:date>
    <item>
      <title>WORK library authorization error when PROC SURVEYMEANS runs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WORK-library-authorization-error-when-PROC-SURVEYMEANS-runs/m-p/965432#M375847</link>
      <description>&lt;P&gt;I'm running SAS 9.4 on Windows. I have a loop that subsets the data, then runs proc surveymeans for the subset of data. The original code is shown below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data step runs successfully, but when the PROC SURVEYMEANS runs I get the error "ERROR: User does not have appropriate authorization level for library WORK". I ran it again after changing the library where the "exp_dat&amp;amp;m" datasets and the output datasets are stored to a different library, yet the same error related to the WORK library appears. When I reduced the number of repweights columns to 44, so the repweights option is wgt1-wgt44, the macro runs without error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Why does it say I do not have access to the library WORK even though I'm running SAS locally on Windows and should have full access to the WORK library?&lt;/LI&gt;&lt;LI&gt;Why does the same WORK related error message appear when I change the library to a different location?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because it runs without error when there are only 44 repweights columns, I think the error has something to do with the amount of time the proc surveymeans takes. It usually takes 5ish minutes of the proc surveymeans running before the error shows up. Maybe some security system on my computer times out access after the process takes more than X minutes. If this is the case, is there a way I could break the processing into chunks so I can still use all 999 repweights columns.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%macro loopsvm;
	%DO m = 1 %to 5;
	data exp_dat&amp;amp;m;
	set exp_dat;
	where IMPLIC = &amp;amp;m;
	run;
	
		PROC SURVEYMEANS DATA=exp_dat&amp;amp;m VARMETHOD=brr MEAN;
			WEIGHT wgt0;
			REPWEIGHTS wgt1-wgt999;
			VAR MORTGAGE RENT PROPTAX;
			DOMAIN igroup;
			ODS OUTPUT domain = Z&amp;amp;m;
		RUN; 
		DATA Z&amp;amp;m; SET Z&amp;amp;m; m=&amp;amp;m; RUN;
		ODS output close;
	%END;
	DATA mi_expvars_igroup; 
		SET Z:;
	RUN;
	PROC DELETE DATA=Z1 Z2 Z3 Z4 Z5; RUN;
	
%mend;
%loopsvm;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 15:14:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WORK-library-authorization-error-when-PROC-SURVEYMEANS-runs/m-p/965432#M375847</guid>
      <dc:creator>eiger</dc:creator>
      <dc:date>2025-04-30T15:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: WORK library authorization error when PROC SURVEYMEANS runs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WORK-library-authorization-error-when-PROC-SURVEYMEANS-runs/m-p/965436#M375848</link>
      <description>&lt;P&gt;Usually that type of error is caused by some other process locking the file.&amp;nbsp; Check your Windows machine for Virus Scanning software or auto backup/archive software that might be locking the file.&amp;nbsp; See if you can disable them for the folder you are using for WORK.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 16:01:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WORK-library-authorization-error-when-PROC-SURVEYMEANS-runs/m-p/965436#M375848</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-04-30T16:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: WORK library authorization error when PROC SURVEYMEANS runs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WORK-library-authorization-error-when-PROC-SURVEYMEANS-runs/m-p/965437#M375849</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/465981"&gt;@eiger&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm running SAS 9.4 on Windows. I have a loop that subsets the data, then runs proc surveymeans for the subset of data. The original code is shown below.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You should read the section in the online help in the syntax section of the BY statement about subsetting the data in the survey procs, such as you are doing, does not yield valid subpopulation analysis.&lt;/P&gt;
&lt;P&gt;With Surveymeans the appropriate approach would be to add the subsetting variable(s) to the DOMAIN statement and then select the values as needed for your reports. You can have more than one variable on the Domain statement. The order of the variables does affect the order of the output data sets so may want to experiment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that adding your IMPLIC variable to the Domain statement would also mean no Macro loop is needed. The syntax to get levels of Implic with each level of Igroup would be :&lt;/P&gt;
&lt;P&gt;Domain Igroup * Implic ; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 16:36:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WORK-library-authorization-error-when-PROC-SURVEYMEANS-runs/m-p/965437#M375849</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-04-30T16:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: WORK library authorization error when PROC SURVEYMEANS runs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WORK-library-authorization-error-when-PROC-SURVEYMEANS-runs/m-p/965985#M376006</link>
      <description>&lt;P&gt;I paused syncing to OneDrive and the program ran without a problem. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 07 May 2025 14:30:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WORK-library-authorization-error-when-PROC-SURVEYMEANS-runs/m-p/965985#M376006</guid>
      <dc:creator>eiger</dc:creator>
      <dc:date>2025-05-07T14:30:01Z</dc:date>
    </item>
  </channel>
</rss>

