Hi:
In addition to the reading that Scott has suggested, I suggest that you read about how macro variables are used and referenced:
http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a001071889.htm
http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a001071910.htm
This bit of documentation on Macro Quoting functions is a good explanation of how macro quoting works by masking the macro variable with a "delta" character:
http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a001061351.htm
When the macro processor masks a text string, it masks special characters and mnemonics within the coding scheme, and prefixes and suffixes the string with a hexadecimal character, called a delta character. The prefix character marks the beginning of the string and also indicates what type of macro quoting is to be applied to the string. The suffix character marks the end of the string. The prefix and suffix characters preserve any leading and trailing blanks contained by the string. The hexadecimal characters used to mask special characters and mnemonics and the characters used for the prefix and suffix might vary and are not portable.
There are more hexadecimal combinations possible in each byte than are needed to represent the symbols on a keyboard. Therefore, when a macro quoting function recognizes an item to be masked, the macro processor uses a previously unused hexadecimal combination for the prefix and suffix characters.
I can't think of any reason to use the CATS function to build a macro variable reference because normally, the %LET statement strips leading and trailing blanks from macro variables. In addition, it seems the reason you are using the CATS function is to prefix and append single quotes to a resolved macro variable value so you can build a quoted string for a new macro variable value. This snippet of macro code shows how macro concatenation works. Note how the macro variables &V1 &V2 and &V3 are used to build new macro variables, as shown in the SAS log:
[pre]
14 %let v1 = Kermit;
15 %let v2 = the;
16 %let v3 = Frog;
17
18 %put &v1&v2&v3;
KermittheFrog
19 %put &v1-&v2-&v3;
Kermit-the-Frog
20 %put &v1 &v2 &v3;
Kermit the Frog
21
22
23 %let NewMacVar = &v1 &v2 &v3;
24 %let NewMacVar2 = %str(%')&NewMacVar%str(%');
25 %put &NewMacVar;
Kermit the Frog
26 %put &NewMacVar2;
'Kermit the Frog'
[/pre]
Generally speaking, it is not a good idea to "prequote" macro variable values. The quotes that you use belong to SAS program statements, such as a title statement or an assignment statement:
[pre]
data testit;
var1 = "&NewMacVar";
var2 = "&NewMacVar2";
run;
proc print data=testit;
run;
[/pre]
The above program produces this output in the LISTING window:
[pre]
Obs var1 var2
1 Kermit the Frog 'Kermit the Frog'
[/pre]
If you WANTED the quotes to be part of the value for VAR2, then it would be acceptable to put quotes into the &NewMacVar2 variable value. However, pre-quoting macro variables can lead to syntax errors later in your code when you go to use the macro variables -- not in the above program, but there are usages of &NewMacVar2 that could lead to quoting issues in program code and you might see "open code recursion" error messages or you might see "meaning of an identifier after a quoted string" messages or you might just get lost in unbalanced quote-land if you're not careful in the places where you use the "pre-quoted" macro variable value.
But since you haven't explained the purpose for your macro program, it's hard to figure out whether you really have a need to insert single quotes into a macro variable value. This paper might help explain how Macro Quoting works (as a supplement to the documentation):
http://www2.sas.com/proceedings/forum2007/152-2007.pdf
cynthia