When I run SAS macro code, I get the error "Data set WORK.TAJ is already open for output."
Why that could happen?
@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.
@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.
Do you have the TAJ table open and viewed?
Usually that's why. Ensure the table is closed before running the macro again.
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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!