<?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: DDE : using macro variables inside put statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DDE-using-macro-variables-inside-put-statement/m-p/505467#M135358</link>
    <description>&lt;P&gt;You are not resolving the macro code.&amp;nbsp; To resolve macro code it needs to be within double quotes:&lt;/P&gt;
&lt;PRE&gt;'[select("R2C%sysevalf(&amp;amp;id+3):R100C%sysevalf(&amp;amp;id+3)")]';&lt;/PRE&gt;
&lt;P&gt;The double quotes here are within single quotes, therefore part of the text.&amp;nbsp; Maybe something like.&lt;/P&gt;
&lt;PRE&gt;data _null_;
  file DDEcmds;
  str=cats('[select(',"R2C%sysevalf(&amp;amp;id+3):R100C%sysevalf(&amp;amp;id+3)"),']');
  put str;
  put '[Format.Number("#,##0")]';    
run;&lt;/PRE&gt;
&lt;P&gt;Again though,&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;DDE is a dead technology, from 30 years + out of service.&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Oct 2018 08:54:46 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-10-18T08:54:46Z</dc:date>
    <item>
      <title>DDE : using macro variables inside put statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DDE-using-macro-variables-inside-put-statement/m-p/505464#M135356</link>
      <description>&lt;P&gt;Hello guys, I want to use macro variables inside the put statement. When I use numbers it works perfectly, but when I replace numbers with macro variables, it doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename DDEcmds&amp;nbsp; dde 'excel|system';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;file DDEcmds;&lt;BR /&gt;put '[select("R2C%sysevalf(&amp;amp;id+3):R100C%sysevalf(&amp;amp;id+3)")]';&lt;BR /&gt;put '[Format.Number("#,##0")]';&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 08:47:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DDE-using-macro-variables-inside-put-statement/m-p/505464#M135356</guid>
      <dc:creator>AlexeyS</dc:creator>
      <dc:date>2018-10-18T08:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: DDE : using macro variables inside put statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DDE-using-macro-variables-inside-put-statement/m-p/505466#M135357</link>
      <description>&lt;P&gt;Macro Variables don't resolve if they are within single quotes.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 08:54:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DDE-using-macro-variables-inside-put-statement/m-p/505466#M135357</guid>
      <dc:creator>DanielLangley</dc:creator>
      <dc:date>2018-10-18T08:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: DDE : using macro variables inside put statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DDE-using-macro-variables-inside-put-statement/m-p/505467#M135358</link>
      <description>&lt;P&gt;You are not resolving the macro code.&amp;nbsp; To resolve macro code it needs to be within double quotes:&lt;/P&gt;
&lt;PRE&gt;'[select("R2C%sysevalf(&amp;amp;id+3):R100C%sysevalf(&amp;amp;id+3)")]';&lt;/PRE&gt;
&lt;P&gt;The double quotes here are within single quotes, therefore part of the text.&amp;nbsp; Maybe something like.&lt;/P&gt;
&lt;PRE&gt;data _null_;
  file DDEcmds;
  str=cats('[select(',"R2C%sysevalf(&amp;amp;id+3):R100C%sysevalf(&amp;amp;id+3)"),']');
  put str;
  put '[Format.Number("#,##0")]';    
run;&lt;/PRE&gt;
&lt;P&gt;Again though,&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;DDE is a dead technology, from 30 years + out of service.&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 08:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DDE-using-macro-variables-inside-put-statement/m-p/505467#M135358</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-18T08:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: DDE : using macro variables inside put statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DDE-using-macro-variables-inside-put-statement/m-p/505469#M135360</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/42503"&gt;@AlexeyS&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use &lt;EM&gt;double&lt;/EM&gt; quotes and &lt;EM&gt;double double&lt;/EM&gt; quotes to avoid the single quotes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put "[select(""R2C%sysevalf(&amp;amp;id+3):R100C%sysevalf(&amp;amp;id+3)"")]";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 08:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DDE-using-macro-variables-inside-put-statement/m-p/505469#M135360</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-18T08:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: DDE : using macro variables inside put statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DDE-using-macro-variables-inside-put-statement/m-p/505471#M135361</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put '[select("R2C%sysevalf(&amp;amp;id+3):R100C%sysevalf(&amp;amp;id+3)")]';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The outermost single quotes prevent all macro trigger resolution.&lt;/P&gt;
&lt;P&gt;Use an intermediate string:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;length string $50;
string = '[select("R2C' !! "%sysevalf(&amp;amp;id+3):R100C%sysevalf(&amp;amp;id+3)" !! '")]';
put string;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Oct 2018 09:09:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DDE-using-macro-variables-inside-put-statement/m-p/505471#M135361</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-18T09:09:05Z</dc:date>
    </item>
  </channel>
</rss>

