John there is a difference in macro language parsing and sas language parsing. Gergely Bathó already mentioned that. With the datastep and proc sql you can put literally every kind of character into a macro variable SAS(R) 9.4 SQL Procedure User's Guide (using macro vars) the trim is explicitly activated with concatenating the content. As it mentioned is not by default. for the datastep there is new function SAS(R) 9.4 Functions and CALL Routines: Reference, Third Edition (symputx) is trims space and let you control wich symboltable you are using. Be carefull on that one too as local tables can or may not be nested. The macro quoting (SAS(R) 9.4 Macro Language: Reference, Second Edition - SAS(R) 9.4 Macro Language: Reference, Second Edition (%quote an %unquote) are to be used when you are defining character in a macro-variable that can conflict with the macro-language. Very predictable and constant in behavior. As rule of thumb: when possible conflicting chars can occur use %nrquote at the moment of defining and %unquote when using.
... View more