From: saikumarkorrapati on
use the code :

libname dummy clear;



thanks
sai kumar

Excimer_Gong wrote:
> Hi,=20
>
> I'd like to clear the libref after calling a stored macro.=20
> It always said the library is still in use.
> Can anyone know how to do?
>
> 1 libname Dummy "C:\SAS Library\Dummy" access=3Dreadonly;
> NOTE: Libref DUMMY was successfully assigned as follows:
> Engine: V9
> Physical Name: C:\SAS Library\Dummy
> 2 options mstored sasmstore =3DDummy;
> 3 %_Macro_Dummy_
> 4 libname Dummy;
> ERROR: Unable to clear or re-assign the library DUMMY because it is
> still in use.
> ERROR: Error in the LIBNAME statement.
>
> Best regards
> Excimer

From: rjf2 on
> From: Excimer_Gong
> I'd like to clear the libref after calling a stored macro.
> It always said the library is still in use.
> Can anyone know how to do?
>
> 1 libname Dummy "C:\SAS Library\Dummy" access=readonly;
> NOTE: Libref DUMMY was successfully assigned as follows:
> Engine: V9
> Physical Name: C:\SAS Library\Dummy
> 2 options mstored sasmstore =Dummy;
> 3 %_Macro_Dummy_
> 4 libname Dummy;
> ERROR: Unable to clear or re-assign the library DUMMY because
> it is still in use.
> ERROR: Error in the LIBNAME statement.

Why do you think you want to do this?

the issues are:
* options sasmstore points to a libref: Dummy
* ... which contains the catalog: Dummy.catalog.SASmacr;
* ... which contains the macro : Dummy.catalog.SASmacr._Macro_Dummy_;

line 3 shows us that you executed a stored and compiled macro

now you want to clear the libref:

options nomstored;*sasmstore no longer enabled;
run;
libname Dummy clear;
run;

I do not guarantee that this works
but this appears to disable the reference to the stored and compiled
macro catalog
which is necessary for you to be able to the clear the libref.

see my paper:
Tutorials
A SASautos Companion: Reusing Macros
http://www2.sas.com/proceedings/sugi30/267-30.pdf

about these pairs of options.

Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov

By using your intelligence
you can sometimes make your problems twice as complicated.
-- Ashleigh Brilliant