<?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: Macro quoting issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-issue/m-p/125930#M294281</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the issue.&amp;nbsp; I'm an idiot lol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code is a small section of a large loop process, and one of the files had ((( in its name.&amp;nbsp; So&amp;nbsp; the macro call looked like follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&lt;SPAN style="color: #999900;"&gt;&lt;EM&gt;%&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;DatasetNames(i:\projects\mycsv(((Version1.csv,outputdataset)&lt;/SPAN&gt;;&amp;nbsp; As such, without the quotes I believe SAS was trying to read in a new set of () conditions, and thus it was combining macro variable 1 and 2 into 1 variable and causing all of my problems.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;When I re-run the code with a file that does not have these ((( values the process works. (Plus it works with Method two). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;In case I run into more of these files I am going to re-code the macros to use version two instead of version 1, as it is safer. Plus I agree with your comment Tom that you can pass in File Refs which seem like a added flexibility that I never thought of.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Aug 2013 22:40:01 GMT</pubDate>
    <dc:creator>Anotherdream</dc:creator>
    <dc:date>2013-08-29T22:40:01Z</dc:date>
    <item>
      <title>Macro quoting issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-issue/m-p/125925#M294276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom's suggestion lead me to my problem, and I found the issue. Please see my last comment to see the exact error I was causing!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As always, Thanks Tom&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello everyone. Can anyone help me understand what is going wrong with the following code? I don't know what I did incorrectly. note that the code inside the macro works (if instead of "&amp;amp;dsin"&amp;nbsp; I simply replace it with "&amp;amp;inputfile" it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that taking inputfile and making it an entry into the macro call is causing my macro to no longer work, which does not make any sense to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #999900; font-size: 10pt; font-family: Consolas;"&gt;&lt;EM&gt;%let &lt;SPAN style="color: #000000;"&gt;inputfile=i:\projects\mycsv.csv;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&lt;SPAN style="color: #999900;"&gt;&lt;EM&gt;%macro &lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;DatasetNames(dsin,dsout)&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&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;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;SPAN style="color: black;"&gt;infile "&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="color: navy;"&gt;dsin.&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;" dsd &lt;BR /&gt;lrecl=32000 truncover obs=1&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&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;&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;&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;&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;&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;&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;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;SPAN style="color: #999900;"&gt;&lt;EM&gt;%mend&lt;/EM&gt;&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;&lt;SPAN style="color: #999900;"&gt;&lt;EM&gt;%&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;DatasetNames(&amp;amp;inputfile,outputdataset)&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;In addition, the following code also works, it is a modifiation of the above.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #999900; font-size: 10pt; font-family: Consolas;"&gt;&lt;EM&gt;%let &lt;SPAN style="color: #000000;"&gt;inputfile=i:\projects\mycsv.csv;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&lt;SPAN style="color: #999900;"&gt;&lt;EM&gt;%macro &lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;DatasetNames(dsin,dsout)&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&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;&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;dsin.&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt; dsd &lt;BR /&gt;lrecl=32000 truncover obs=1&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&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;&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;&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;&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;&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;&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;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;SPAN style="color: #999900;"&gt;&lt;EM&gt;%mend&lt;/EM&gt;&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;&lt;SPAN style="color: #999900;"&gt;&lt;EM&gt;%&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;DatasetNames("&amp;amp;inputfile",outputdataset)&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;So adding the quotes into the macro call instead of within the macro itself causes this to run. I don't understand why however.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 20:30:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-issue/m-p/125925#M294276</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-08-29T20:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Macro quoting issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-issue/m-p/125926#M294277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh also, the error&amp;nbsp; I am getting is the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FAILed to open "I:\projects\mycsv.csv , Outputdataset);"&amp;nbsp; :&amp;nbsp; The system cannot find the file specified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it looks like the system is not recognizing that the first macro varaible is SEPERATED from the second one by the comma in the macro call. It's almost like it's blurring both of them together, which makes no sene to me.&amp;nbsp; :smileyangry:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 20:36:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-issue/m-p/125926#M294277</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-08-29T20:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Macro quoting issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-issue/m-p/125927#M294278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the broken one you left out the &amp;amp; in the reference to &amp;amp;DSNIN.&lt;/P&gt;&lt;P&gt;Personally I prefer the second one as it adds the flexibility of allowing you to pass in a fileref rather than only accepting a physical path. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: Consolas; color: #999900; background-color: #ffffff;"&gt;filename in '&lt;SPAN style="font-style: inherit; font-family: inherit; color: #000000;"&gt;i:\projects\mycsv.csv' ;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; background-color: #ffffff; color: #999900;"&gt;&lt;EM style="font-family: inherit;"&gt;%&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background-color: #ffffff; color: black;"&gt;DatasetNames(in,outputdataset)&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 22:20:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-issue/m-p/125927#M294278</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-08-29T22:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Macro quoting issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-issue/m-p/125928#M294279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry that was a copy error. Even with the &amp;amp; inside thhis section of code it does not work and throws the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So even with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #999900; font-family: Consolas; font-size: 10pt;"&gt;&lt;EM&gt;%let &lt;SPAN style="color: #000000;"&gt;inputfile=i:\projects\mycsv.csv;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&lt;SPAN style="color: #999900;"&gt;&lt;EM&gt;%macro &lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;DatasetNames(dsin,dsout)&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&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;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;SPAN style="color: black;"&gt;infile "&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="color: navy;"&gt;dsin.&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;" dsd &lt;BR /&gt;lrecl=32000 truncover obs=1&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&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;&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;&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;&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;&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;&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;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;SPAN style="color: #999900;"&gt;&lt;EM&gt;%mend&lt;/EM&gt;&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&lt;SPAN style="color: #999900;"&gt;&lt;EM&gt;%&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;DatasetNames(&amp;amp;inputfile,outputdataset)&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;I am still getting errors&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 22:28:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-issue/m-p/125928#M294279</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-08-29T22:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Macro quoting issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-issue/m-p/125929#M294280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works fine for me. You might have unbalanced quotes somewhere. Kill SAS and start over.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MPRINT(DATASETNAMES):&amp;nbsp;&amp;nbsp; data outputdataset;&lt;/P&gt;&lt;P&gt;MPRINT(DATASETNAMES):&amp;nbsp;&amp;nbsp; infile "i:\projects\mycsv.csv" dsd lrecl=32000 truncover obs=1;&lt;/P&gt;&lt;P&gt;MPRINT(DATASETNAMES):&amp;nbsp;&amp;nbsp; length varnumCSV 8 name $2000.;&lt;/P&gt;&lt;P&gt;MPRINT(DATASETNAMES):&amp;nbsp;&amp;nbsp; input @;&lt;/P&gt;&lt;P&gt;MPRINT(DATASETNAMES):&amp;nbsp;&amp;nbsp; do varnumCSV = 1 to countw(_infile_,',','Q');&lt;/P&gt;&lt;P&gt;MPRINT(DATASETNAMES):&amp;nbsp;&amp;nbsp; input name @;&lt;/P&gt;&lt;P&gt;MPRINT(DATASETNAMES):&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;MPRINT(DATASETNAMES):&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;MPRINT(DATASETNAMES):&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 22:35:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-issue/m-p/125929#M294280</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-08-29T22:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Macro quoting issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-issue/m-p/125930#M294281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the issue.&amp;nbsp; I'm an idiot lol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code is a small section of a large loop process, and one of the files had ((( in its name.&amp;nbsp; So&amp;nbsp; the macro call looked like follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&lt;SPAN style="color: #999900;"&gt;&lt;EM&gt;%&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;DatasetNames(i:\projects\mycsv(((Version1.csv,outputdataset)&lt;/SPAN&gt;;&amp;nbsp; As such, without the quotes I believe SAS was trying to read in a new set of () conditions, and thus it was combining macro variable 1 and 2 into 1 variable and causing all of my problems.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;When I re-run the code with a file that does not have these ((( values the process works. (Plus it works with Method two). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;In case I run into more of these files I am going to re-code the macros to use version two instead of version 1, as it is safer. Plus I agree with your comment Tom that you can pass in File Refs which seem like a added flexibility that I never thought of.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 22:40:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-issue/m-p/125930#M294281</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-08-29T22:40:01Z</dc:date>
    </item>
  </channel>
</rss>

