BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
lioradam
Obsidian | Level 7

Hello all, 

I have trouble with adding comments by using an asterisk at the beginning and at the end of the comment.

before the comment, I enter /* and after the comment, I enter */.  Most of the time, it works fine, however, sometimes it doesn't work (I enter */ at the end of the comment and the following code is still colored in green).

 

Does anyone had this trouble and know how to fix it?

Thanks in advance,

Lior

1 ACCEPTED SOLUTION

Accepted Solutions
Quentin
Super User

If your editor has the coloring wrong, you can often fix it with a * comment, e.g.:

* fix syntax coloring ;
The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.

View solution in original post

4 REPLIES 4
Tom
Super User Tom
Super User

@lioradam wrote:

Hello all, 

I have trouble with adding comments by using an asterisk at the beginning and at the end of the comment.

before the comment, I enter /* and after the comment, I enter */.  Most of the time, it works fine, however, sometimes it doesn't work (I enter */ at the end of the comment and the following code is still colored in green).

 

Does anyone had this trouble and know how to fix it?

Thanks in advance,

Lior


Coloring is some feature of the editor you are using, not the SAS language itself.  The editor does not really know the impact of all of the various SAS syntaxes, especially if you are using macro code at all. 

 

To tell if your comments are entered correctly you need to run the code.

 

Block comments start with /* and end with */ and cannot be nested.

Statement comments start with * and end with a semi-colon (just like any other SAS statement).

Macro statement comments start with %* and end with a semi-colon (just like any other macro statement).

Quentin
Super User

If your editor has the coloring wrong, you can often fix it with a * comment, e.g.:

* fix syntax coloring ;
The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
lioradam
Obsidian | Level 7

Thank you,

Lior

lioradam
Obsidian | Level 7

Thank you!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 664 views
  • 1 like
  • 3 in conversation