<?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: Resolving macro variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Resolving-macro-variables/m-p/547488#M151729</link>
    <description>&lt;P&gt;Pay attention that any &amp;amp;&amp;amp; are in first step replaced by &amp;amp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;amp;&amp;amp;&amp;amp;X = (&amp;amp;&amp;amp;) &amp;amp;X - (1) resolve &amp;amp;X then resolve &amp;amp;(resolved value)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;amp;&amp;amp;&amp;amp;&amp;amp;X = (&amp;amp;&amp;amp;)(&amp;amp;&amp;amp;)x = &amp;amp;&amp;amp;X = &amp;amp;X&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope that explains the behavior.&lt;/P&gt;</description>
    <pubDate>Sun, 31 Mar 2019 15:01:11 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2019-03-31T15:01:11Z</dc:date>
    <item>
      <title>Resolving macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolving-macro-variables/m-p/547482#M151724</link>
      <description>&lt;P&gt;Hi, I have the below code:&lt;/P&gt;&lt;P&gt;%let a=b;&lt;BR /&gt;%let b=c;&lt;BR /&gt;%let c=a;&lt;/P&gt;&lt;P&gt;%let d=&amp;amp;c; %let e=&amp;amp;&amp;amp;c; %let f=&amp;amp;&amp;amp;&amp;amp;c; %let g=&amp;amp;&amp;amp;&amp;amp;&amp;amp;c; %let h=&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;c; %let i=&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;c;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;check="&amp;amp;d";output;&lt;BR /&gt;check="&amp;amp;e";output;&lt;BR /&gt;check="&amp;amp;f";output;&lt;BR /&gt;check="&amp;amp;g";output;&lt;BR /&gt;check="&amp;amp;h";output;check="&amp;amp;i";output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;d resolves to a&lt;/P&gt;&lt;P&gt;e resolves to a&lt;/P&gt;&lt;P&gt;f resolves to b&lt;/P&gt;&lt;P&gt;g resolves to a&lt;/P&gt;&lt;P&gt;h resolves to b&lt;/P&gt;&lt;P&gt;I resolves to b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please explain how this is happening? According to my logic, g should resolve to b and h should resolve to c and I to c.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there is a diagrammatical representation, it will be helpful.&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2019 13:42:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolving-macro-variables/m-p/547482#M151724</guid>
      <dc:creator>nimmy_mj</dc:creator>
      <dc:date>2019-03-31T13:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Resolving macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolving-macro-variables/m-p/547484#M151725</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/28356i24B677A7FD9D0026/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2019 13:55:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolving-macro-variables/m-p/547484#M151725</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2019-03-31T13:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Resolving macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolving-macro-variables/m-p/547488#M151729</link>
      <description>&lt;P&gt;Pay attention that any &amp;amp;&amp;amp; are in first step replaced by &amp;amp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;amp;&amp;amp;&amp;amp;X = (&amp;amp;&amp;amp;) &amp;amp;X - (1) resolve &amp;amp;X then resolve &amp;amp;(resolved value)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;amp;&amp;amp;&amp;amp;&amp;amp;X = (&amp;amp;&amp;amp;)(&amp;amp;&amp;amp;)x = &amp;amp;&amp;amp;X = &amp;amp;X&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope that explains the behavior.&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2019 15:01:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolving-macro-variables/m-p/547488#M151729</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-03-31T15:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Resolving macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolving-macro-variables/m-p/547496#M151730</link>
      <description>&lt;P&gt;Turn the SYMBOLGEN option and see for yourself what is happening.&lt;/P&gt;
&lt;PRE&gt;1     %let a=b;
2     %let b=c;
3     %let c=a;
4     options symbolgen;
5     %let d=&amp;amp;c;
SYMBOLGEN:  Macro variable C resolves to a
6    %let e=&amp;amp;&amp;amp;c;
SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.
SYMBOLGEN:  Macro variable C resolves to a
7    %let f=&amp;amp;&amp;amp;&amp;amp;c;
SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.
SYMBOLGEN:  Macro variable C resolves to a
SYMBOLGEN:  Macro variable A resolves to b
8    %let g=&amp;amp;&amp;amp;&amp;amp;&amp;amp;c;
SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.
SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.
SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.
SYMBOLGEN:  Macro variable C resolves to a
9    %let h=&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;c;
SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.
SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.
SYMBOLGEN:  Macro variable C resolves to a
SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.
SYMBOLGEN:  Macro variable A resolves to b
10   %let i=&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;c;
SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.
SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.
SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.
SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.
SYMBOLGEN:  Macro variable C resolves to a
SYMBOLGEN:  Macro variable A resolves to b
11   options nosymbolgen;&lt;/PRE&gt;</description>
      <pubDate>Sun, 31 Mar 2019 15:42:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolving-macro-variables/m-p/547496#M151730</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-31T15:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Resolving macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolving-macro-variables/m-p/547655#M151785</link>
      <description>&lt;P&gt;You might be better off using %PUT statements to determine the evaluation of your data. The data step you use will set the length of the variable CHECK to the length of the first variable. Which could result in truncation. Please see:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let a=b;
%let b= somethinglonger;

data test;
check="&amp;amp;a.";output;
check="&amp;amp;b.";output;
run;
proc print data=test;
run;&lt;/PRE&gt;
&lt;P&gt;compare with:&lt;/P&gt;
&lt;PRE&gt;%put A is: &amp;amp;a.;
%put B is: &amp;amp;b.;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Apr 2019 16:42:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolving-macro-variables/m-p/547655#M151785</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-01T16:42:09Z</dc:date>
    </item>
  </channel>
</rss>

