BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SamiBG
Calcite | Level 5

Hi community,

 

I am trying to find the error in the following Macro but I am not sure I got. Any thoughts?

Thanks in advance 🙂

%MACRO Cleanup;

   %IF &syserr <= 0 %THEN

          DO;

                proc sql;

                       drop table W.BASE;

                quit;

 

          END;

%MEND Cleanup;

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I see two errors, there may be more. It should be

 

%MACRO Cleanup;
   %IF &syserr <= 0 %THEN %DO;
                proc sql;
                       drop table W.BASE;
                quit;
    %END;
%MEND Cleanup;

If there are still errors, use the command

options mprint;

at the start of the program and show us the entire LOG for this macro (do not chop anything out of the LOG). Please preserve the formatting of the log by copying it as text and then pasting it into the window that appears when you click on the </> icon. DO NOT SKIP THIS STEP.

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

I see two errors, there may be more. It should be

 

%MACRO Cleanup;
   %IF &syserr <= 0 %THEN %DO;
                proc sql;
                       drop table W.BASE;
                quit;
    %END;
%MEND Cleanup;

If there are still errors, use the command

options mprint;

at the start of the program and show us the entire LOG for this macro (do not chop anything out of the LOG). Please preserve the formatting of the log by copying it as text and then pasting it into the window that appears when you click on the </> icon. DO NOT SKIP THIS STEP.

--
Paige Miller
SamiBG
Calcite | Level 5

Hi PaigeMiller,

 

Thanks alot for the quick answer. That was what I was looking for 🙂

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1007 views
  • 0 likes
  • 2 in conversation