<?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: How can I mask the colon in the path, while invoking a macro? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-mask-the-colon-in-the-path-while-invoking-a-macro/m-p/96200#M27177</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are using SUPERQ incorrectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think the colon needs to be quoted.&amp;nbsp; You need two dots after &amp;amp;NAME any you may need to %UNQUOTE all that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Dec 2012 12:22:54 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2012-12-11T12:22:54Z</dc:date>
    <item>
      <title>How can I mask the colon in the path, while invoking a macro?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-mask-the-colon-in-the-path-while-invoking-a-macro/m-p/96199#M27176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%macro import(path,name, out, sheet);&lt;/P&gt;&lt;P&gt;proc import datafile ="&amp;amp;path\&amp;amp;name.xls" &lt;/P&gt;&lt;P&gt;out=&amp;amp;out(where= (refid ~= .))&lt;/P&gt;&lt;P&gt;dbms=excel replace;&lt;/P&gt;&lt;P&gt;sheet= "&amp;amp;sheet";&lt;/P&gt;&lt;P&gt;mixed = yes;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend import;&lt;/P&gt;&lt;P&gt;Suppose I want call macro with path like "d:\Clin-Dem\HCC\New Folder". How can I mask the colon in the path?&lt;/P&gt;&lt;P&gt;%import(%superq(d:\Clin-Dem\HCC\New Folder),%str(Cheng, Ann-Lii_2009_vol10), dataset4, Template);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 12:05:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-mask-the-colon-in-the-path-while-invoking-a-macro/m-p/96199#M27176</guid>
      <dc:creator>devarayalu</dc:creator>
      <dc:date>2012-12-11T12:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can I mask the colon in the path, while invoking a macro?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-mask-the-colon-in-the-path-while-invoking-a-macro/m-p/96200#M27177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are using SUPERQ incorrectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think the colon needs to be quoted.&amp;nbsp; You need two dots after &amp;amp;NAME any you may need to %UNQUOTE all that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 12:22:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-mask-the-colon-in-the-path-while-invoking-a-macro/m-p/96200#M27177</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-12-11T12:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: How can I mask the colon in the path, while invoking a macro?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-mask-the-colon-in-the-path-while-invoking-a-macro/m-p/96201#M27178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And perhaps a period after &amp;amp;path&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example that I use with multiple macro variables in an output file name:&lt;/P&gt;&lt;P&gt;&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;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN lang="EN"&gt;%let&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;outpath= D:\Data\WIC\Nutrition Surveillance Rpt\Trend\output\ ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods rtf file="&amp;amp;outpath.district_&amp;amp;district._&amp;amp;syear._&amp;amp;eyear..rtf"&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;lt;options follow&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 15:26:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-mask-the-colon-in-the-path-while-invoking-a-macro/m-p/96201#M27178</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-12-11T15:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I mask the colon in the path, while invoking a macro?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-mask-the-colon-in-the-path-while-invoking-a-macro/m-p/96202#M27179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't need one after &amp;amp;PATH it is followed by back-splash :smileyblush:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 15:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-mask-the-colon-in-the-path-while-invoking-a-macro/m-p/96202#M27179</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-12-11T15:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: How can I mask the colon in the path, while invoking a macro?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-mask-the-colon-in-the-path-while-invoking-a-macro/m-p/96203#M27180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like data _null_ said, you don't have to quote the colon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest the following changes.&amp;nbsp; (I'm sending this from home, so don't have SAS in front of me to test):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; Use keyword instead of positional parameters.&amp;nbsp; It makes the syntax clearer, and IIRC removes the significance of the comma in your name parameter.&lt;/P&gt;&lt;P&gt;2)&amp;nbsp; If your parameters could contain tokens significant to the macro processor, you would use %superq *inside* the macro, not in the parameter declaration.&lt;/P&gt;&lt;P&gt;3)&amp;nbsp; If a macro variable contains text immediately following that would make the macro variable reference ambiguous, use a dot to mark the end of the macro variable reference.&amp;nbsp; So, like data _null_ said, you need two dots after &amp;amp;name, one to mark the end of the macro variable reference, and one as the filename extension delimiter.&lt;/P&gt;&lt;P&gt;4)&amp;nbsp; Most punctuation and whitespace will mark the end of a macro variable reference, so a following dot is not required.&amp;nbsp; I see some programmers "overuse" the dot to end a macro variable reference, when it's not required.&amp;nbsp; It works, but I personally find this syntax harder to read and a bit "ugly".&amp;nbsp; But that's just me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this and see how it works for you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro import(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; path=&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,name= &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,out= &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,sheet=&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;proc import &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; datafile="%superq(path)\%superq(name).xls" &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; out=&amp;amp;out (where=(refid is not missing))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; dbms=excel &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; replace;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; sheet="&amp;amp;sheet";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; mixed=yes;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, you could use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;datafile="&amp;amp;path\&amp;amp;name..xls" &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as long has your path or name variables aren't too funky, with characters that would confuse the macro processor.&amp;nbsp; Usually %superq() is needed in macro statements such as %if %superq(mvar) ne %str() ..., but while %superq in the above syntax may be over-cautious, it won't hurt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%import(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; path=d:\Clin-Dem\HCC\New Folder&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,name=Cheng, Ann-Lii_2009_vol10 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,out=dataset4 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,sheet=Template&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the comma in the name parameter confuses the macro processor, try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name=%str(Cheng, Ann-Lii_2009_vol10)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 16:17:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-mask-the-colon-in-the-path-while-invoking-a-macro/m-p/96203#M27180</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2012-12-11T16:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: How can I mask the colon in the path, while invoking a macro?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-mask-the-colon-in-the-path-while-invoking-a-macro/m-p/96204#M27181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why not use %str() ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 01:11:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-mask-the-colon-in-the-path-while-invoking-a-macro/m-p/96204#M27181</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-12-12T01:11:36Z</dc:date>
    </item>
  </channel>
</rss>

