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 ;
BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: 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 ;
BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
lioradam
Obsidian | Level 7

Thank you,

Lior

lioradam
Obsidian | Level 7

Thank you!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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