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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 15 replies
  • 1696 views
  • 0 likes
  • 6 in conversation