BookmarkSubscribeRSS Feed
Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

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?

4 REPLIES 4
igbuzov
Calcite | Level 5

hi

can you give us the code?

Astounding
PROC Star

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.

Patrick
Opal | Level 21

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"

Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 864 views
  • 0 likes
  • 4 in conversation