Special Characters in SAS

Tag: sas Author: xy5989523 Date: 2011-05-07

HI , I'm trying to use * special character in SAS Statement but it see it as commenting character , so is there any method that allow me to mask it , as to use it as special character not as commenting character.

here is the statement that am trying to use * in it:

%let source=/home/sas/SASMR/Reports/*.pdf;

as a result of this , it comment what is come next to * .

Here is a reference regarding quoting in SAS www2.sas.com/proceedings/forum2007/152-2007.pdf . As @richie sasy, %str() is probably what you want here. However, you also say you want to use this as a "special character" so I'm curious what you plan to do with this. If you are trying to send a command to the OS, there may be cleaner ways to do it.
It is the combination of "/*" that is starting a comment. Ritchie's solution works by breaking up this combo...

Other Answer1

If you just need a quick solution, this worked for me.

%let source=/home/sas/SASMR/Reports/%str(*).pdf; 
%put &source;

/home/sas/SASMR/Reports/*.pdf