I am writing a SAS program which also uses some macros. However, SAS suddenly stopped running the codes that I submitted. If I select and submit a part of the code, I can see it copied in the log but that's it. No note, error or warning. Neither is the code executed. Doesn't matter if the code is a simple data step without any macro variables. Am I missing anything? What should I check or verify?
-
2This question should be clear to experienced SAS users, it's a trap that many have fallen into when quotes used in macro code are unmatched – Longfish Jun 06 '14 at 13:04
-
@Keith If you feel that way, you have enough rep (now!) to cast reopen votes - please feel free to do so. – Joe Jun 06 '14 at 14:29
-
@user3714321 While I think this is probably an acceptable question as is, it would have been improved by a bit more detail - perhaps your whole code is too much for this, but an example of what kind of macros you're writing would be helpful at a minimum to make it more clear what you're doing. – Joe Jun 06 '14 at 14:30
3 Answers
This sounds like a classic case of unbalanced quotes within one of your macros. Running the code below should clear it, then you will need to check the code for the error.
*); */; /*’*/ /*”*/; %mend;

- 7,582
- 13
- 19
-
2ps, I'm not sure why the question has been put on hold. This is a scenario that many experienced SAS users will have come across some time in their career and the symptons described are therefore embedded in the brain. I'm sure I'm not the only one who tore their hair out when it first happened! – Longfish Jun 06 '14 at 11:26
-
+1 for... 'I'm sure I'm not the only one who tore their hair out when it first happened!' SAS needs to improve the log message for such things cause it happens to almost everyone at some point and we waste too much time for an error of this magnitude. – Keneni Jun 06 '14 at 16:25
-
This same problem happened with me during macro coding except it was unmatched parentheses. Original line of problem code was
"...%then %let DLINE=%str(if (P ge 22 and STAFF eq 0 then STAFF=1;);"
Note unmatched "(" character before P variable. Either removing the "(" or adding ")" after "eq 0" solves problem.

- 11
- 2
I figure out why I also got this issue.
When I collapse all the macro code ( a temporary one just in the same file of my project code), and rerun it.
SAS actually just run the collapsed part, so it is just the first row of the macro.
The code above solves my problem, but I also need to rerun the expanded macro code again to avoid future error.

- 1