Help using Base SAS procedures

macro error

Super Contributor
Super Contributor
Posts: 464

macro error

running the same macro twice with different arguments and when sas starts executing the second macro  i am  getting this  below:

ERROR: You cannot open for output access with member-level control because is in use by you

in resource environment Program

any idea what might be causing this guys?

New Contributor
Posts: 3

Re: macro error


can you give us the code?

Super User
Posts: 6,785

Re: macro error

It sounds like your macro opens the data set, but then fails to close it once it is no longer needed.  So the second run tries to open a data set that is already open.

You'll have to inspect the macro to see where this happens, and add the closing logic at the right spot.

Good luck.

Respected Advisor
Posts: 4,736

Re: macro error

Are you using SAS EG by any chance? If so then make sure that under "Options/Results General" you untick box "Automatically open data or results when generated".

What could happen: Your macro wants to create/write to the same table twice but the table gets opened (and locked) after the first time you touch it.

I also would untick "Options/Data General/Automatically open data when added to project"

And under "Options/SAS Programs" have a tick in "close all open data before running code"

Super Contributor
Super Contributor
Posts: 464

Re: macro error

yes it is EG and  i changed the settings as per your instructions but still same errors. I also checked with other co-workers.They have the same options checked and they can run the code with no errors. It is exactly the same code. When i run the macro separately it works just fine

Ask a Question
Discussion stats
  • 4 replies
  • 4 in conversation