<?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 problem in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-problem/m-p/35469#M7011</link>
    <description>&lt;B&gt;Curtis,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your reply. When I run your code I get the following errors:&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
371               put &amp;amp;q.[select("R&amp;amp;&amp;amp;Header&amp;amp;I..C1:R&amp;amp;&amp;amp;Header&amp;amp;I..C1")]&amp;amp;q.;             put&lt;BR /&gt;
                          ______&lt;BR /&gt;
                          68&lt;BR /&gt;
371      ! '[font.properties("MS Sans Serif","Bold",10,,,,,,,1)]';&lt;BR /&gt;
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, arrayname, &lt;BR /&gt;
              #, (, +, /, //, ;, @, @@, OVERPRINT, _ALL_, _BLANKPAGE_, _ODS_, _PAGE_.  &lt;BR /&gt;
&lt;BR /&gt;
ERROR 200-322: The symbol is not recognized and will be ignored.&lt;BR /&gt;
&lt;BR /&gt;
ERROR 68-185: The function SELECT is unknown, or cannot be accessed.&lt;BR /&gt;
&lt;BR /&gt;
ERROR: Undeclared array referenced: NAME.&lt;BR /&gt;
&lt;BR /&gt;
           _&lt;BR /&gt;
           22&lt;BR /&gt;
           200</description>
    <pubDate>Tue, 22 Mar 2011 18:06:19 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2011-03-22T18:06:19Z</dc:date>
    <item>
      <title>Macro quoting problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-problem/m-p/35467#M7009</link>
      <description>I have what I think is a quoting problem. In the code below the PUT/SELECT statement doesn't work because the macro variables are inside single quotes. Is there a way around this?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
   filename cmds dde "excel|system";&lt;BR /&gt;
   data file3x_reformat;&lt;BR /&gt;
      file cmds;&lt;BR /&gt;
       %macro reformat;&lt;BR /&gt;
         %do i=1 %to &amp;amp;count_header;&lt;BR /&gt;
            %let selectcmd = &lt;BR /&gt;
            put '[select("R&amp;amp;&amp;amp;Header&amp;amp;I..C1:R&amp;amp;&amp;amp;Header&amp;amp;I..C1")]';&lt;BR /&gt;
            put '[font.properties("MS Sans Serif","Bold",10,,,,,,,1)]';&lt;BR /&gt;
         %end;&lt;BR /&gt;
      %mend reformat;&lt;BR /&gt;
      %reformat;&lt;BR /&gt;
   run;</description>
      <pubDate>Tue, 22 Mar 2011 16:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-problem/m-p/35467#M7009</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-22T16:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Macro quoting problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-problem/m-p/35468#M7010</link>
      <description>I've had luck putting a single quote in a marco var and using it instead of quotes in the put statements.  Something like this (untested because I don't have your data).&lt;BR /&gt;
&lt;BR /&gt;
%let q = %nrstr(%');&lt;BR /&gt;
%put &amp;amp;q;&lt;BR /&gt;
&lt;BR /&gt;
filename cmds dde "excel|system";&lt;BR /&gt;
data file3x_reformat;&lt;BR /&gt;
file cmds;&lt;BR /&gt;
%macro reformat;&lt;BR /&gt;
%do i=1 %to &amp;amp;count_header;&lt;BR /&gt;
%let selectcmd = &lt;BR /&gt;
put &amp;amp;q.[select("R&amp;amp;&amp;amp;Header&amp;amp;I..C1:R&amp;amp;&amp;amp;Header&amp;amp;I..C1")]&amp;amp;q.;&lt;BR /&gt;
put &amp;amp;q.[font.properties("MS Sans Serif","Bold",10,,,,,,,1)]&amp;amp;q.;&lt;BR /&gt;
%end;&lt;BR /&gt;
%mend reformat;&lt;BR /&gt;
%reformat;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Curtis</description>
      <pubDate>Tue, 22 Mar 2011 17:19:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-problem/m-p/35468#M7010</guid>
      <dc:creator>CurtisMack</dc:creator>
      <dc:date>2011-03-22T17:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Macro quoting problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-problem/m-p/35469#M7011</link>
      <description>&lt;B&gt;Curtis,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your reply. When I run your code I get the following errors:&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
371               put &amp;amp;q.[select("R&amp;amp;&amp;amp;Header&amp;amp;I..C1:R&amp;amp;&amp;amp;Header&amp;amp;I..C1")]&amp;amp;q.;             put&lt;BR /&gt;
                          ______&lt;BR /&gt;
                          68&lt;BR /&gt;
371      ! '[font.properties("MS Sans Serif","Bold",10,,,,,,,1)]';&lt;BR /&gt;
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, arrayname, &lt;BR /&gt;
              #, (, +, /, //, ;, @, @@, OVERPRINT, _ALL_, _BLANKPAGE_, _ODS_, _PAGE_.  &lt;BR /&gt;
&lt;BR /&gt;
ERROR 200-322: The symbol is not recognized and will be ignored.&lt;BR /&gt;
&lt;BR /&gt;
ERROR 68-185: The function SELECT is unknown, or cannot be accessed.&lt;BR /&gt;
&lt;BR /&gt;
ERROR: Undeclared array referenced: NAME.&lt;BR /&gt;
&lt;BR /&gt;
           _&lt;BR /&gt;
           22&lt;BR /&gt;
           200</description>
      <pubDate>Tue, 22 Mar 2011 18:06:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-problem/m-p/35469#M7011</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-22T18:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Macro quoting problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-problem/m-p/35470#M7012</link>
      <description>I suspected that would happen, but I did not know what the rest of the code would do.&lt;BR /&gt;
&lt;BR /&gt;
I think what you might really want to do is use double quotes and then double them up when you want one inside the string.&lt;BR /&gt;
&lt;BR /&gt;
data file3x_reformat;&lt;BR /&gt;
file cmds;&lt;BR /&gt;
%macro reformat;&lt;BR /&gt;
%do i=1 %to &amp;amp;count_header;&lt;BR /&gt;
%let selectcmd = &lt;BR /&gt;
put "[select(""R&amp;amp;&amp;amp;Header&amp;amp;I..C1:R&amp;amp;&amp;amp;Header&amp;amp;I..C1"")]";&lt;BR /&gt;
put "[font.properties(""MS Sans Serif"",""Bold"",10,,,,,,,1)]";&lt;BR /&gt;
%end;&lt;BR /&gt;
%mend reformat;&lt;BR /&gt;
%reformat;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
This assumes that your code has a pseudo macro array of HEADER1 - HEADER&amp;amp;count_header;</description>
      <pubDate>Tue, 22 Mar 2011 18:15:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-problem/m-p/35470#M7012</guid>
      <dc:creator>CurtisMack</dc:creator>
      <dc:date>2011-03-22T18:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Macro quoting problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-problem/m-p/35471#M7013</link>
      <description>Thanks Curtis, that worked!&lt;BR /&gt;
&lt;BR /&gt;
Jeff</description>
      <pubDate>Tue, 22 Mar 2011 18:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-problem/m-p/35471#M7013</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-22T18:42:56Z</dc:date>
    </item>
  </channel>
</rss>

