From @Tom
Are not browsing one the datasets in the library? None
Did you open the library with any of the old SCL functions like OPEN() and forget to close it? No
Did you use the libref in some other options like FMTSEARCH that would keep the libref in use? No
Do you really need to write the library? What happens if you initially define the libref with the ACCESS=READONLY option? I do need write access.
From @SASKiwi
In addition to @Tom's checklist add any SAS procedure that is accessing that library that requires a QUIT statement to exit. Examples are PROC SQL, PROC DATASETS. I will check this, that sounds possible, I have written a very long macro, and it could be that somewhere in there I am missing a quit.
Another thought I had is that sometimes I have to stop the macro while it is running, so I hit the break icon. (This is usually because I have provided an incorrect argument somewhere, rather than bugs, which I think are few) Maybe that's where the issue comes in, and would explain why this is not repeatable. If that is a possibility, its not clear to me how to verify this or fix this, if you have any ideas, please let me know.
... View more