<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help with masking macro quotes in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126705#M294379</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;anotherdream,&amp;nbsp;&amp;nbsp; I see you are desperately wanting to have it coded, that names, by using macro-language, but did you ever being thinking of doing it in some other approach?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem with all those special chars is caused by different interpretations while being passed in all involved language processors.&lt;/P&gt;&lt;P&gt;If you could bypass that and just passing it as datastep variables using symput/symget the cause is eliminted. -&amp;gt; no issues anymore.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/hostwin/64812/HTML/default/viewer.htm#n07buc7sg08fdrn1c1jmmr8hl78r.htm" title="http://support.sas.com/documentation/cdl/en/hostwin/64812/HTML/default/viewer.htm#n07buc7sg08fdrn1c1jmmr8hl78r.htm"&gt;SAS(R) 9.4 Companion for Windows&lt;/A&gt; (infile statement) A lot is possible with wildcards and using a feedback getting the name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%quote( ) and %unquote( )&amp;nbsp; are sometimes needed but requirng some attention &lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/64754/HTML/default/viewer.htm#p1780jrqrtwtw7n16x83peo2zpxr.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/64754/HTML/default/viewer.htm#p1780jrqrtwtw7n16x83peo2zpxr.htm"&gt;SAS(R) 9.4 Macro Language: Reference&lt;/A&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 31 Aug 2013 09:17:22 GMT</pubDate>
    <dc:creator>jakarman</dc:creator>
    <dc:date>2013-08-31T09:17:22Z</dc:date>
    <item>
      <title>Help with masking macro quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126701#M294375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone. I need some help with understanding the masking of specific characters being passed into Macro's. This is actually related to a problem that Tom helped me solve the other day, however it has arisen in a seperate problem (I will use the first for simplicity).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Okay, the following code does not work. the reason is the FIRST macro input has a "(" within the name, so when sas Reads the macro (in the call step) it is reading an open parenthesis, and it is thus assuming macro variable 1 and 2 are the same (since it does not find a closed parenthesis).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #999900; font-size: 10pt; font-family: Consolas;"&gt;&lt;EM&gt;%macro &lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: Consolas; font-size: 10pt;"&gt;Mapping_Names(dsin,dsout)&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: black; font-family: Consolas; font-size: 10pt;"&gt;data &lt;/SPAN&gt;&lt;SPAN style="color: navy; font-family: Consolas; font-size: 10pt;"&gt;&amp;amp;dsout.&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;SPAN style="color: black;"&gt;infile "&lt;/SPAN&gt;&lt;SPAN style="color: navy;"&gt;&amp;amp;dsin.&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;" dsd&amp;nbsp; lrecl=32000 truncover obs=1&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;SPAN style="color: black;"&gt;length varnumCSV 8 name $2000.&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp; &lt;SPAN style="color: black;"&gt;input @&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp; &lt;SPAN style="color: black;"&gt;do varnumCSV = 1 to countw(_infile_,',','Q')&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: black;"&gt;input name @&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: black;"&gt;output&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp; &lt;SPAN style="color: black;"&gt;end&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;SPAN style="color: black;"&gt;run&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #999900; font-size: 10pt; font-family: Consolas;"&gt;&lt;EM&gt;%mend&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: Consolas; font-size: 10pt;"&gt; Mapping_names;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #999900; font-size: 10pt; font-family: Consolas;"&gt;&lt;EM&gt;%Mapping_Names&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: Consolas; font-size: 10pt;"&gt;(tab verification(((Greengiant Population&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: Consolas; font-size: 10pt;"&gt;, outputdata)&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So basically I want to pass the entire first string (up until the comma) as a single string into sas, and I would like it to ignore the ((( values after the word Verification. This is because someone is naming files with these values (I can't change this). I also have written macro's that will open Excel files and then run the associated VBA within the Excel files (like the following) and someone named an excel with with a "(" in its title so I ran into the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro runexcel_example(excelfile,macroname);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;SPAN style="color: black;"&gt;FILENAME xcel DDE "EXCEL|SYSTEM"&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file xcel;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "[open(""&amp;amp;excelfile."")]";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "[open(""&amp;amp;macroname."")]";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "[quit()]";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;%mend runexceL_example;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;%runexcel_Example(I:\projects\multi(files.xlsm&amp;nbsp; ,&amp;nbsp;&amp;nbsp; multi(files.xlsm!Multifiles.multifiles);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Note that this macro program works for every macro we have, except for when the names have special characters (namly these parenthesis).&amp;nbsp; Is there a way to hide these values&amp;nbsp; and have sas put them directly into the file so it doesn't combine both macro varaibles into 1 variable and blow up the program?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I am thinking something along the lines of the %str, or %nstr, or %quote values but I have not been able to figure this one out!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Brandon&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt;"&gt;&amp;amp;macrovariable.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;"")]";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Aug 2013 21:15:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126701#M294375</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-08-30T21:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help with masking macro quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126702#M294376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And if this is not possible, could anyone help me re-write the second program so that I can quote the macro variable itself but still get it into Macro form?&amp;nbsp; Aka how would I get something along the lines of the following to work...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro runexcel_example(excelfile,macroname);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;SPAN style="color: black;"&gt;FILENAME xcel DDE "EXCEL|SYSTEM"&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file xcel;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "[open(&amp;amp;excelfile.)]";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "[open(&amp;amp;macroname.)]";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "[quit()]";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;%mend runexceL_example;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;%runexcel_Example("I:\projects\multi(files.xlsm " ,&amp;nbsp;&amp;nbsp; "multi(files.xlsm!Multifiles.multifiles");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;This above code DOES NOT WORK, as I can't pass a macro string with double quotes into the put statement, and I'm sure there is a way to do this, but as of yet I cannot get it to work. If anyone can solve this it would be greatly appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Aug 2013 21:22:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126702#M294376</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-08-30T21:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help with masking macro quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126703#M294377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is some code I have used to pass macro values in DDE calls. Not the use of %' to mask quotes from the macro quoteing functions.&lt;/P&gt;&lt;P&gt;You &lt;STRONG&gt;may&lt;/STRONG&gt; not want to have the macro period concatenaion indicator when not actually needing it for this purpose.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN lang="EN"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;put %unquote(%str(%'[OPEN("&amp;amp;outpath.&amp;amp;&amp;amp;Sd&amp;amp;i SIR 2012 Summary.xml")]%'));&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;put '[ERROR("FALSE")]';&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;put %unquote(%str(%'[SAVE.AS("&amp;amp;Excelpath.&amp;amp;&amp;amp;Sd&amp;amp;i SIR 2012 Summary.xlsx",51)]%'));&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Aug 2013 22:18:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126703#M294377</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-08-30T22:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help with masking macro quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126704#M294378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In SAS when you want to express a literal that contains the quote character you double the quote character on the inside. For example: &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;answer = 'I don''t know' ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The QUOTE() function will quote a string and will double any quote characters that it contains.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let fname=The "big" file.xls ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;filename in %sysfunc(quote(&amp;amp;fname));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The $QUOTE. format will do the same for a character variable. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;%macro runexcel_example(excelfile,macroname);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-style: inherit; color: black;"&gt;FILENAME xcel DDE "EXCEL|SYSTEM"&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'courier new', courier; color: #000080;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'courier new', courier; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file xcel;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'courier new', courier; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; excelfile = symget('excelfile');&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'courier new', courier; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; macroname = symget('macroname');&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'courier new', courier; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put '[open(' excelfile :$quote. +(-1) ')]';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'courier new', courier; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put '[open(' macroname :$quote. +(-1) ')]';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put '[quit()]';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'courier new', courier;"&gt;%mend runexceL_example;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Aug 2013 22:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126704#M294378</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-08-30T22:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help with masking macro quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126705#M294379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;anotherdream,&amp;nbsp;&amp;nbsp; I see you are desperately wanting to have it coded, that names, by using macro-language, but did you ever being thinking of doing it in some other approach?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem with all those special chars is caused by different interpretations while being passed in all involved language processors.&lt;/P&gt;&lt;P&gt;If you could bypass that and just passing it as datastep variables using symput/symget the cause is eliminted. -&amp;gt; no issues anymore.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/hostwin/64812/HTML/default/viewer.htm#n07buc7sg08fdrn1c1jmmr8hl78r.htm" title="http://support.sas.com/documentation/cdl/en/hostwin/64812/HTML/default/viewer.htm#n07buc7sg08fdrn1c1jmmr8hl78r.htm"&gt;SAS(R) 9.4 Companion for Windows&lt;/A&gt; (infile statement) A lot is possible with wildcards and using a feedback getting the name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%quote( ) and %unquote( )&amp;nbsp; are sometimes needed but requirng some attention &lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/64754/HTML/default/viewer.htm#p1780jrqrtwtw7n16x83peo2zpxr.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/64754/HTML/default/viewer.htm#p1780jrqrtwtw7n16x83peo2zpxr.htm"&gt;SAS(R) 9.4 Macro Language: Reference&lt;/A&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Aug 2013 09:17:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126705#M294379</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-08-31T09:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with masking macro quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126706#M294380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are many macro quoting functions, for this example %SUPERQ() is probably the easiest.&lt;/P&gt;&lt;P&gt;Assuming that the macro variable NAME1 has the first filename that you want to pass to your macro for processing, you would write the macro call like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas; background-color: #ffffff; color: #999900;"&gt;&lt;EM&gt;%Mapping_Names&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas; background-color: #ffffff; color: black;"&gt;(%superq(name1)&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas; background-color: #ffffff; color: black;"&gt;, outputdata)&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Aug 2013 15:52:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126706#M294380</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-08-31T15:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help with masking macro quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126707#M294381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Tom! As an additional question to this, (your example using %superq worked for files with ( in their names)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would one go about creating a macro that reads in files that contain quotes within their names? Aka if you had a file named&lt;/P&gt;&lt;P&gt;Bob o'conner.csv, how would one go about readin this into a macro as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #999900; font-family: Consolas; font-size: 10pt;"&gt;&lt;EM&gt;%macro &lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: Consolas; font-size: 10pt;"&gt;Mapping_Names(dsin,dsout)&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: black; font-family: Consolas; font-size: 10pt;"&gt;data &lt;/SPAN&gt;&lt;SPAN style="color: navy; font-family: Consolas; font-size: 10pt;"&gt;&amp;amp;dsout.&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;SPAN style="color: black;"&gt;infile &lt;/SPAN&gt;&lt;SPAN style="color: navy;"&gt;&amp;amp;dsin.&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt; dsd&amp;nbsp; lrecl=32000 truncover obs=1&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;SPAN style="color: black;"&gt;length varnumCSV 8 name $2000.&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp; &lt;SPAN style="color: black;"&gt;input @&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp; &lt;SPAN style="color: black;"&gt;do varnumCSV = 1 to countw(_infile_,',','Q')&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: black;"&gt;input name @&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: black;"&gt;output&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp; &lt;SPAN style="color: black;"&gt;end&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;SPAN style="color: black;"&gt;run&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #999900; font-family: Consolas; font-size: 10pt;"&gt;&lt;EM&gt;%mend&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: Consolas; font-size: 10pt;"&gt; Mapping_names;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Consolas; font-size: 10pt;"&gt;I know you can do %mapping_names("C:\users\Bob o'conner.csv",outputdataset), however if I wanted to specify Bob o'conner as a macro variable, I would have to double quote it and call the macro like following.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Consolas; font-size: 10pt;"&gt;%let var1="C:\users\Bob o'conner.csv";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Consolas; font-size: 10pt;"&gt;%Mapping_names(&amp;amp;var1,outputdataset).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Consolas; font-size: 10pt;"&gt;My question is, what if I had a dataset that contained a list of 1000+ files that I wanted to loop through, and the double quotes did not exist around the datafile name? is there a quoteing function that adds double quotes to your macro variables for you? I'm pretty confident i've seen this before, but I can't get anything to work in this example... So i'm looking for something along the lines of .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Consolas; font-size: 10pt;"&gt;%mapping_names(%quote(&amp;amp;var1),outputdataset); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Consolas; font-size: 10pt;"&gt;Where var1 is assigned from a call symputx in a loop on a existing dataset!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Consolas; font-size: 10pt;"&gt;Thanks again!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2013 15:24:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126707#M294381</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-09-11T15:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help with masking macro quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126708#M294382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%SUPERQ() is useful when you have no idea what types of characters might be in your macro variable, which is common issue when the variable is generated from data via CALL SYMPUTX or PROC SQL INTO: syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you already have the VAR1 macro variable created then you can safely make it a quoted string like this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas; background-color: #ffffff;"&gt;%mapping_names(%sysfunc(quote(%superq(var1))),outputdataset);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You could also change the way VAR1 is generated.&amp;nbsp; For example if you have the variable FILENAME in the dataset FILELIST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas; background-color: #ffffff;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas; background-color: #ffffff;"&gt;&amp;nbsp; set filelist;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas; background-color: #ffffff;"&gt;&amp;nbsp; call symputx(cats('var',_n_),quote(trim(filename)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas; background-color: #ffffff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas; background-color: #ffffff;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-family: Consolas;"&gt;%mapping_names(&amp;amp;var1,outputdataset);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2013 15:33:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-masking-macro-quotes/m-p/126708#M294382</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-09-11T15:33:20Z</dc:date>
    </item>
  </channel>
</rss>

