<?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: ERROR: Unable to clear or re-assign the library MACROS because it is still in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17848#M2619</link>
    <description>This won't help you now, but when 9.3 is released, it will include a &lt;BR /&gt;
%SYSMSTORECLEAR statement that will allow users to specifically&lt;BR /&gt;
have the catalog associated with the libref specified in the SASMSTORE=&lt;BR /&gt;
closed and the libref cleared.</description>
    <pubDate>Mon, 13 Dec 2010 15:25:08 GMT</pubDate>
    <dc:creator>PatrickG</dc:creator>
    <dc:date>2010-12-13T15:25:08Z</dc:date>
    <item>
      <title>ERROR: Unable to clear or re-assign the library MACROS because it is still</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17844#M2615</link>
      <description>I am getting the following error message  everytimeI run the sas program. The error message is not being displayed when I start a new SAS session.&lt;BR /&gt;
&lt;BR /&gt;
The syntax which i am trying  to use is as follows&lt;BR /&gt;
libname macros 'U:\Macros';&lt;BR /&gt;
options mstored  sasmstore =macros;&lt;BR /&gt;
options linesize=200 pagesize=100;&lt;BR /&gt;
ods listing;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
646  libname macros 'U:\Macros';&lt;BR /&gt;
ERROR: Unable to clear or re-assign the library MACROS because it is still in use.&lt;BR /&gt;
ERROR: Error in the LIBNAME statement.&lt;BR /&gt;
646!                            647  options mstored  sasmstore =macros;&lt;BR /&gt;
648  options linesize=200 pagesize=100;&lt;BR /&gt;
649  ods listing;&lt;BR /&gt;
&lt;BR /&gt;
Is there a way to get around this?</description>
      <pubDate>Fri, 15 Oct 2010 23:27:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17844#M2615</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-10-15T23:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Unable to clear or re-assign the library MACROS because it is still</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17845#M2616</link>
      <description>Clearly you have SAS code being executed in advance of the code that is giving the error -- so what is that code doing and how is it using the "libref" allocation for "MACROS"?  You need to review yourself, and, if needed, share the code (preferably in a SAS log) that is being executed before the error, such as lines 1 through 645 -- I expect you will see why SAS is complaining about the open LIBNAME &lt;LIBREF&gt; allocation.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;/LIBREF&gt;</description>
      <pubDate>Sat, 16 Oct 2010 05:49:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17845#M2616</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-10-16T05:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Unable to clear or re-assign the library MACROS because it is still</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17846#M2617</link>
      <description>Just out of curiosity... Are you running in enterprise guide?  I get this when we are running code in Enterprise Guide.</description>
      <pubDate>Thu, 21 Oct 2010 19:48:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17846#M2617</guid>
      <dc:creator>LAP</dc:creator>
      <dc:date>2010-10-21T19:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Unable to clear or re-assign the library MACROS because it is still</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17847#M2618</link>
      <description>Hello Lucy,&lt;BR /&gt;
&lt;BR /&gt;
I has this message in Enterprise Guide. The reason is that when you assign a library for saving macros it is locked until the SAS session is closed. &lt;BR /&gt;
&lt;BR /&gt;
When you run your program second time you are trying to reassign the locked macro library which is impossible. My advice is to highlight the part of the program excluding "libname macros 'U:\Macros';" and execute the highlighted part only.&lt;BR /&gt;
&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Thu, 21 Oct 2010 20:09:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17847#M2618</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2010-10-21T20:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Unable to clear or re-assign the library MACROS because it is still</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17848#M2619</link>
      <description>This won't help you now, but when 9.3 is released, it will include a &lt;BR /&gt;
%SYSMSTORECLEAR statement that will allow users to specifically&lt;BR /&gt;
have the catalog associated with the libref specified in the SASMSTORE=&lt;BR /&gt;
closed and the libref cleared.</description>
      <pubDate>Mon, 13 Dec 2010 15:25:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17848#M2619</guid>
      <dc:creator>PatrickG</dc:creator>
      <dc:date>2010-12-13T15:25:08Z</dc:date>
    </item>
    <item>
      <title>ERROR: Unable to clear or re-assign the library MACROS because it is still</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17849#M2620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I haven't found an elegant solution, but I'm using this code in Enterprise Guide:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- start code --;&lt;/P&gt;&lt;P&gt;data _NULL_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length WORD $8;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do j = 1 to 8;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WORD = byte(int(65 + ranuni(0)*26)) || WORD;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput("mylibrary", WORD);&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname &amp;amp;mylibrary 'physical_path_to_library';&lt;/P&gt;&lt;P&gt;*-- end code --;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This assign every time a different random LIBREF to you library.&lt;/P&gt;&lt;P&gt;It works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Paolo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2011 11:37:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17849#M2620</guid>
      <dc:creator>pcavicch</dc:creator>
      <dc:date>2011-08-02T11:37:36Z</dc:date>
    </item>
    <item>
      <title>ERROR: Unable to clear or re-assign the library MACROS because it is still</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17850#M2621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Lucy&lt;/P&gt;&lt;P&gt;this seems a very parallel thread.&lt;/P&gt;&lt;P&gt;See my response in the other, at&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://communities.sas.com/message/102072#102072"&gt;http://communities.sas.com/message/102072#102072&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When (if) this problem occurs in enterprise guide, instead of puting code in the autexec, place your "one-time-code" at the code box in &lt;/P&gt;&lt;P&gt;menu: tools/options/sas programs/"submit code when server is connected"/edit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2011 12:21:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17850#M2621</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-08-02T12:21:04Z</dc:date>
    </item>
    <item>
      <title>ERROR: Unable to clear or re-assign the library MACROS because it is still</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17851#M2622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you trying to point the libref to a different location? Or are you just re-running the code that assigned the libref?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the latter then test first before defining the library.&amp;nbsp; Here is can example command using the IFC and LIBREF functions to conditionally issue the libname statement only when the libref does not already exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp; %sysfunc(ifc(%sysfunc(libref(macros)),libname macros '~/temp',));&lt;/P&gt;&lt;P&gt;NOTE: Libref MACROS was successfully assigned as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Engine:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; V9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Physical Name: /home/abernt/temp&lt;/P&gt;&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp; %sysfunc(ifc(%sysfunc(libref(macros)),libname macros '~/temp',));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other thing to consider is changing the SASMSTORE option before trying to modify the libref.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2011 14:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Unable-to-clear-or-re-assign-the-library-MACROS-because-it/m-p/17851#M2622</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-08-02T14:13:53Z</dc:date>
    </item>
  </channel>
</rss>

