<?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 resolve macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-resolve-macro-variable/m-p/582069#M165506</link>
    <description>&lt;P&gt;Change your code into:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let I=1;
%let state1=ap;
%let ap1=India;
%let India1=Asia;
/*First  - I want to resolve ap1 macro variable I wrote like below. */
Data ex1;
Name="&amp;amp;&amp;amp;&amp;amp;state&amp;amp;I&amp;amp;&amp;amp;I." ; 
Run;

/*Second*/
I want to resolve India1 macro variable I wrote like below.
Data ex2;
Name="&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;state&amp;amp;I&amp;amp;&amp;amp;i.";
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Remember - sas resolves macros step by step. Each pair of &amp;amp;&amp;amp; become a single &amp;amp;, thus:&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;1) &amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;state&amp;amp;I&amp;amp;&amp;amp;i&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;2) &amp;amp;&amp;amp;&amp;amp;state1&amp;amp;i&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;3) &amp;amp;&amp;amp;ap1&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;4) India&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Aug 2019 08:53:29 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2019-08-19T08:53:29Z</dc:date>
    <item>
      <title>How resolve macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-resolve-macro-variable/m-p/582053#M165498</link>
      <description>%let I=1;&lt;BR /&gt;%let state1=ap;&lt;BR /&gt;%let ap1=India;&lt;BR /&gt;%let India1=Asia;&lt;BR /&gt;/*First*/&lt;BR /&gt;I want to resolve ap1 macro variable I wrote like below.&lt;BR /&gt;Data ex1;&lt;BR /&gt;Name="&amp;amp;&amp;amp;&amp;amp;state&amp;amp;I." ;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;/*Second*/&lt;BR /&gt;I want to resolve India1 macro variable I wrote like below.&lt;BR /&gt;Data ex2;&lt;BR /&gt;Name="&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;state&amp;amp;I.";&lt;BR /&gt;Run;&lt;BR /&gt;But above 2 codes not working the macro variables are not resolving</description>
      <pubDate>Mon, 19 Aug 2019 06:39:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-resolve-macro-variable/m-p/582053#M165498</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2019-08-19T06:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: How resolve macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-resolve-macro-variable/m-p/582054#M165499</link>
      <description>&lt;P&gt;Just to be clear, what do you want the value of Name to be in the two code snippets?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 06:49:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-resolve-macro-variable/m-p/582054#M165499</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-08-19T06:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: How resolve macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-resolve-macro-variable/m-p/582055#M165500</link>
      <description>First: name=India&lt;BR /&gt;Second name=asia&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Aug 2019 07:03:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-resolve-macro-variable/m-p/582055#M165500</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2019-08-19T07:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: How resolve macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-resolve-macro-variable/m-p/582058#M165501</link>
      <description>&lt;P&gt;Are the macro variables fixed or can I change them a bit? Seems easier not having the 1 in all of them&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 07:17:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-resolve-macro-variable/m-p/582058#M165501</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-08-19T07:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: How resolve macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-resolve-macro-variable/m-p/582068#M165505</link>
      <description>&lt;P&gt;Please try the below code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
Data ex1;
Name="&amp;amp;&amp;amp;&amp;amp;state&amp;amp;I.&amp;amp;&amp;amp;i" ;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Aug 2019 08:40:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-resolve-macro-variable/m-p/582068#M165505</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-08-19T08:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: How resolve macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-resolve-macro-variable/m-p/582069#M165506</link>
      <description>&lt;P&gt;Change your code into:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let I=1;
%let state1=ap;
%let ap1=India;
%let India1=Asia;
/*First  - I want to resolve ap1 macro variable I wrote like below. */
Data ex1;
Name="&amp;amp;&amp;amp;&amp;amp;state&amp;amp;I&amp;amp;&amp;amp;I." ; 
Run;

/*Second*/
I want to resolve India1 macro variable I wrote like below.
Data ex2;
Name="&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;state&amp;amp;I&amp;amp;&amp;amp;i.";
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Remember - sas resolves macros step by step. Each pair of &amp;amp;&amp;amp; become a single &amp;amp;, thus:&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;1) &amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;state&amp;amp;I&amp;amp;&amp;amp;i&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;2) &amp;amp;&amp;amp;&amp;amp;state1&amp;amp;i&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;3) &amp;amp;&amp;amp;ap1&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;4) India&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 08:53:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-resolve-macro-variable/m-p/582069#M165506</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-08-19T08:53:29Z</dc:date>
    </item>
  </channel>
</rss>

