BookmarkSubscribeRSS Feed
Cynthia_sas
SAS Super FREQ
Hi:
I do agree with you that almost 100% of the time you should not use a semi-colon when your macro is generating parts of statements. However, I have generated form letters with macro coding, in which the syntax of various text variables that were being built, from concatenated macro variables and text strings and macro calls, did require the use of a semi-colon as punctuation -- for the paragraph to be correct. Those semi-colons then needed to be masked or protected with macro quoting functions so they were treated as part of the text paragraph.

This did not seem an appropriate posting to go into the finer points of when you might need a macro quoting function to protect a semi-colon, a single quote or a percent sign. So I waffled with the "really, really depends".

It seems to me, now, that what I should have said was that if you ALWAYS start with a working SAS program and then figure out what code you need to generate when your macro program executes, you will ALWAYS know, with 100% certainty, whether or not a semi-colon, as needed by SAS, is appropriate.

Thank you for pointing out the imprecision of my language.

cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 15 replies
  • 1970 views
  • 0 likes
  • 6 in conversation