BookmarkSubscribeRSS Feed
JamesD
Calcite | Level 5
At one time I used to know a string of characters that you could submit that would match any unbalanced quotes and or comments in code that was submitted and needed the matching quote to stop running. It was something like */*'/*"/*/;run;

Does anyone know what it is? Thanks.
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
The one I use is:
*'; *"; stop; run; quit; %mend;

which is a variation of the string recommended on page 15 of this document:
http://support.sas.com/publishing/pubcat/chaps/61025.pdf

I keep submitting it over and over until I see this message in the log, because, as it says on page 15:
"Depending on how deep a hole you have dug for yourself, you might need to run this line several times. You’ll know you’re done when you see an error message that says “No matching %MACRO statement for this %MEND statement.” The line works on unbalanced quotes because anything between an asterisk and the next semicolon is treated as a comment by SAS, unless there is an open quote, in which case it is just part of the quote. For example, *”; will close a double quote if one is open, but will not start a new quote."

cynthia
JamesD
Calcite | Level 5
Thanks! That's exactly what I was looking for, but better.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 2 replies
  • 1694 views
  • 0 likes
  • 2 in conversation