SAS comments inside macros

I recently had a bug with SAS comments that I would like to share with you. In SAS, you can mainly use two kinds of comments:

* Here is my comment;
/* Here is my comment */

However, I noted that with SAS 9, the first one may give some problems. I usually program in SAS using Enterprise Guide (EG). Inside a macro, I had a comment of the first kind with a ()

%macro mac1;
   * List of ID's;
   %LET id = 1;
   %PUT id = &id.;
%mend mac1;
%mac1;

In EG, the following code gives no error but never finish executing which is quite annoying. After a few exchanges with the SAS support, they asked me to try the code in Base SAS. I had the following message:

NOTE 49-169: The meaning of an identifier after a quoted string may 
change in a future SAS release.  Inserting white space between a 
quoted string and the succeeding identifier is recommended.

According to me, there are two problems. First, EG should be able to deliver this message. Second, anything written in a comment should not be interpreted by the SAS compiler. SAS support advises to use /* … */ comments in macros, so you’re informed 🙂

Any problems using comments in SAS?

Share

Recommended Reading