Depending on what characters you want to pass as a macro parameter value, you might need to use different SAS macro functions that provide "character masking". These macro functions are collectively called macro quoting functions. There are 7 of them, each has its own set of characters they mask, and the sets of those characters overlap between them. They also differ by their timing: A) macro compilation; or B) macro execution. You use macro compilation functions to mask characters in a string constants not containing & % or mnemonics (GT EQ OR AND etc). And you use macro execution functions otherwise.
Here are the 7 macro quoting functions:
A) Work at macro compilation
B) Work at macro execution
%QUOTE() and %NRQUOTE(), %BQUOTE() and %NRBQUOTE(), and %SUPERQ().
I use "pass them inside the box" analogy to explain how they work in my recent blog post Passing comma-delimited values into SAS macros and macro functions.
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.
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.