06-18-2015 03:13 PM
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 WORK.xxx.DATA for output access with member-level control because WORK.xxx.DATA is in use by you
in resource environment Program temp1.sas.
any idea what might be causing this guys?
06-18-2015 04:06 PM
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.
06-18-2015 09:53 PM
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"
06-19-2015 09:06 AM
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