BookmarkSubscribeRSS Feed
PGStats
Opal | Level 21

I can see a reason... It is unreadable for us mere mortals Smiley Happy

PG

PG
data_null__
Jade | Level 19

What is IT?

Tom
Super User Tom
Super User

Inside a macro definition use regular comments when you want the comment to appear in the log when MPRINT is on.  So when the comment is something that helps the user understand the steps of the program. Use macro comments to comment the macro. So comments that help the coder understand how to maintain the macro, such as why you used a particular option. Use block comments when you need to include semi-colons or unbalanced quotes. Normally in a header block that might include usage examples.

ballardw
Super User

Agreed. But the example was one of the "comment out existing code" which often leads to bad things when it becomes a habit using *; within macros. Especially when & gets involved.

Tom
Super User Tom
Super User

That is another discussion.

In the rare cases where I temporarily comment out macro code by adding a * I also make sure to add the * AFTER the % so that it actually becomes a macro comment.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 19 replies
  • 4340 views
  • 0 likes
  • 9 in conversation