We are having a bit of a debate here ... I am an old time SAS programmer who was told that it is better to semicolon after a macro call ... %macroname; There is another thought that one must never semicolon ... %macroname.
My thinking is that if there were unbalanced semicolons at least this one would make sure that the macro would run. However, there is a note in a course note publication that states the opposite. I know there are times when if a macro call was in the middle of other code it may not be appropriate. I am just wondering about the call itself as stand alone code.
another old $0.02
sometimes the statement needs to be completed with a semicolon after the macro is called.
The macros which generate steps, usually, finish by generating a semicolon on a "run;" Those which generate only statements usually deliver statements completed by a semicolon. These macro invocations should not need a trailing semicolon.
I use a lot of "sub-statement" macros. They are really useful when a string or value needs to be retrieved. These "sub-statement macros" generate no semicolon so that they can be used, for example, in a calculation. It is normally important that these sub-statement macros are not immediately followed by a semicolon.
%put the message at %now() needs action ;
The semicolon ends the statement, not the macro invocation.
The semicolon after the macro call will never be used, will it? (actually if it is part of the logic of the macro-generated code, it should be inside the macro itself).
The only reasonable case when a semicolon will be used after the macro call is when it closes a non-macro statement, as in
title %write_title(big, red, bold);
but then the semicolon is there to close the title statement, not as part of the macro call.
>I have known programmers who put a semicolon in empty lines as spacers.
Unless you are one of these and like extra and unused semicolons, a semicolon after a macro call makes no sense.
My 2 cents, to each their own and all that. Having an extra ; is not a big sin (though it sometimes hides bad understanding of what macros are).