<?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: Double ampersands in a macro. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Double-ampersands-in-a-macro/m-p/25647#M4481</link>
    <description>You have two iterations until the macro var gets resolved. For every iteration a dot is consumed.&lt;BR /&gt;
You need 2 dots.&lt;BR /&gt;
&lt;BR /&gt;
%let row1=1;&lt;BR /&gt;
%let k=1;&lt;BR /&gt;
&lt;BR /&gt;
%put r&amp;amp;&amp;amp;row&amp;amp;k..com(n)=p;&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick</description>
    <pubDate>Fri, 04 Dec 2009 10:43:51 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2009-12-04T10:43:51Z</dc:date>
    <item>
      <title>Double ampersands in a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-ampersands-in-a-macro/m-p/25646#M4480</link>
      <description>I have this macro in the beginning of my program:&lt;BR /&gt;
%macro m1;&lt;BR /&gt;
%do i=1 %to 10;&lt;BR /&gt;
%let row&amp;amp;i=&amp;amp;i;&lt;BR /&gt;
%end;&lt;BR /&gt;
%mend;&lt;BR /&gt;
%m1;&lt;BR /&gt;
&lt;BR /&gt;
With %put &amp;amp;&amp;amp;row&amp;amp;i inside the macro I have checked that the values of row1 to row10 are from 1 to 10.&lt;BR /&gt;
&lt;BR /&gt;
In my main program I have an expression&lt;BR /&gt;
&lt;BR /&gt;
r&amp;amp;&amp;amp;row&amp;amp;k.col(n)=p;      (a dot between k and c)&lt;BR /&gt;
&lt;BR /&gt;
&amp;amp;k is a macro variable ranging from 1 to 10. n is a number from 1 to 5.&lt;BR /&gt;
I have  arrays r1col(5), r2col(5), ... , r10col(5) declared.&lt;BR /&gt;
&lt;BR /&gt;
I expected to get r1col(n)=p, r2col(n)=p, ... and so on.&lt;BR /&gt;
&lt;BR /&gt;
But I get the error message: Apparent symbolic reference ROW1COL not resolved.&lt;BR /&gt;
&lt;BR /&gt;
The same for ROW2COL, and so on.&lt;BR /&gt;
&lt;BR /&gt;
What have I done wrong?</description>
      <pubDate>Fri, 04 Dec 2009 10:25:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-ampersands-in-a-macro/m-p/25646#M4480</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-12-04T10:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Double ampersands in a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-ampersands-in-a-macro/m-p/25647#M4481</link>
      <description>You have two iterations until the macro var gets resolved. For every iteration a dot is consumed.&lt;BR /&gt;
You need 2 dots.&lt;BR /&gt;
&lt;BR /&gt;
%let row1=1;&lt;BR /&gt;
%let k=1;&lt;BR /&gt;
&lt;BR /&gt;
%put r&amp;amp;&amp;amp;row&amp;amp;k..com(n)=p;&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick</description>
      <pubDate>Fri, 04 Dec 2009 10:43:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-ampersands-in-a-macro/m-p/25647#M4481</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2009-12-04T10:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Double ampersands in a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-ampersands-in-a-macro/m-p/25648#M4482</link>
      <description>After adding the dot i get the warning(s):  Apparent symbolic reference ROW1 not resolved.&lt;BR /&gt;
&lt;BR /&gt;
Error message concerning r&amp;amp;row1.col: Statement is not valid or it is used out of proper order.</description>
      <pubDate>Fri, 04 Dec 2009 12:27:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-ampersands-in-a-macro/m-p/25648#M4482</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-12-04T12:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Double ampersands in a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-ampersands-in-a-macro/m-p/25649#M4483</link>
      <description>Check to make sure &amp;amp;row1 is global.  It looks like a local variable to you macro.&lt;BR /&gt;
You would need to have %global row&amp;amp;i ; in your macro.</description>
      <pubDate>Fri, 04 Dec 2009 13:27:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-ampersands-in-a-macro/m-p/25649#M4483</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-12-04T13:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Double ampersands in a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-ampersands-in-a-macro/m-p/25650#M4484</link>
      <description>We're back to the MACRO VARIABLE SCOPING topic, which came up in a prior post/thread.  &lt;BR /&gt;
&lt;BR /&gt;
Your macro creates a macro variable, which by default is LOCAL, however your SAS program attempts to reference a macro variable, so now your macro variables must be declared as GLOBAL type.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
SAS Macro Language: Reference, Scopes of Macro Variables&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a002047080.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a002047080.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
SAS Macro Language: Reference, Introduction to Macro Variables&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a002293823.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a002293823.htm&lt;/A&gt;</description>
      <pubDate>Fri, 04 Dec 2009 16:18:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-ampersands-in-a-macro/m-p/25650#M4484</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-12-04T16:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Double ampersands in a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-ampersands-in-a-macro/m-p/25651#M4485</link>
      <description>We need a list of FPQ  Frequently posted questions.</description>
      <pubDate>Fri, 04 Dec 2009 16:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-ampersands-in-a-macro/m-p/25651#M4485</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-12-04T16:35:44Z</dc:date>
    </item>
  </channel>
</rss>

