BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Tracy29
Fluorite | Level 6

When I run SAS macro code, I get the error "Data set WORK.TAJ is already open for output." 

Why that could happen?

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

@Tracy29 wrote:

When I run SAS macro code, I get the error "Data set WORK.TAJ is already open for output." 

Why is that could happen?


No idea. Posting the ERROR on its own without the code that caused it tells us exactly nothing.

Please post the code you ran successfully before you tried to make it dynamic with a macro. If you do not have such code, you violated rule #1 of macro development: start with working non-macro code.

View solution in original post

3 REPLIES 3
Kurt_Bremser
Super User

@Tracy29 wrote:

When I run SAS macro code, I get the error "Data set WORK.TAJ is already open for output." 

Why is that could happen?


No idea. Posting the ERROR on its own without the code that caused it tells us exactly nothing.

Please post the code you ran successfully before you tried to make it dynamic with a macro. If you do not have such code, you violated rule #1 of macro development: start with working non-macro code.

Reeza
Super User

Do you have the TAJ table open and viewed?

Usually that's why. Ensure the table is closed before running the macro again. 

 

 

DrAbhijeetSafai
Pyrite | Level 9

I found that I had given name of same dataset in the data statement. After correcting that, this error got resolved. 

 

My programme was something like:

data TAJ TAJ;
     set indata;
run;

 

I corrected it to:

data TAJ;
     set indata;
run;

Thank you. 

 

- Dr. Abhijeet Safai

Dr. Abhijeet Safai
Associate Data Analyst
Actu-Real

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Discussion stats
  • 3 replies
  • 1569 views
  • 3 likes
  • 4 in conversation