<?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 About indirect macro variable reference in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/About-indirect-macro-variable-reference/m-p/678611#M23865</link>
    <description>&lt;P&gt;I am currently studying SAS Macro Language 1 essentials course. When I was doing level 2 practice under 3.4 indirect references to macro variables.&amp;nbsp; For question 3, I am confused the answer, "&amp;amp;&amp;amp;&amp;amp;code", why don't use "&amp;amp;&amp;amp;countrycode&amp;amp;code"? Thanks so much. And what does &amp;amp;&amp;amp;&amp;amp;code stand for?&lt;/P&gt;
&lt;DIV id="tinyMceEditorJianan_luna_7" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="tinyMceEditorJianan_luna_8" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Annotation 2020-08-21 181308.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48548i84E5579D01352758/image-size/large?v=v2&amp;amp;px=999" role="button" title="Annotation 2020-08-21 181308.png" alt="Annotation 2020-08-21 181308.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 22 Aug 2020 00:14:42 GMT</pubDate>
    <dc:creator>Jianan_luna</dc:creator>
    <dc:date>2020-08-22T00:14:42Z</dc:date>
    <item>
      <title>About indirect macro variable reference</title>
      <link>https://communities.sas.com/t5/New-SAS-User/About-indirect-macro-variable-reference/m-p/678611#M23865</link>
      <description>&lt;P&gt;I am currently studying SAS Macro Language 1 essentials course. When I was doing level 2 practice under 3.4 indirect references to macro variables.&amp;nbsp; For question 3, I am confused the answer, "&amp;amp;&amp;amp;&amp;amp;code", why don't use "&amp;amp;&amp;amp;countrycode&amp;amp;code"? Thanks so much. And what does &amp;amp;&amp;amp;&amp;amp;code stand for?&lt;/P&gt;
&lt;DIV id="tinyMceEditorJianan_luna_7" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="tinyMceEditorJianan_luna_8" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Annotation 2020-08-21 181308.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48548i84E5579D01352758/image-size/large?v=v2&amp;amp;px=999" role="button" title="Annotation 2020-08-21 181308.png" alt="Annotation 2020-08-21 181308.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Aug 2020 00:14:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/About-indirect-macro-variable-reference/m-p/678611#M23865</guid>
      <dc:creator>Jianan_luna</dc:creator>
      <dc:date>2020-08-22T00:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: About indirect macro variable reference</title>
      <link>https://communities.sas.com/t5/New-SAS-User/About-indirect-macro-variable-reference/m-p/678618#M23866</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; You did not create numbered variables. That is why you don't have &amp;amp;&amp;amp;country&amp;amp;code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Please go back and watch the video on macro variable resolution. In particular the forward scan rule and the rescan rule:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1598056776358.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48552i22FABD3F03787B48/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1598056776358.png" alt="Cynthia_sas_0-1598056776358.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; After your first DATA _NULL_ step, you can insert a %PUT _USER_ and then in the LOG you'll see that the country 2 character code is the macro variable, as shown below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_1-1598056418059.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48551i5011CBBB0D6BD4C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_1-1598056418059.png" alt="Cynthia_sas_1-1598056418059.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if you want to have the macro variable resolve to Luxembourg for the TITLE, you need to use &amp;amp;LU or some reference that will end up turning into &amp;amp;LU and then Luxembourg. And if you wanted it to appear as United Kingdom, you'd need to use &amp;amp;GB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, the WHERE statement needs to use the 2 character code to select the rows you want That's where &amp;amp;code comes in. For the WHERE statement to work, you need to be able to pass in the string "LU" or "IT" or "GB" -- but then, as long as you have that string and you can use that string for a macro variable, then indirect references allows &amp;amp;&amp;amp;&amp;amp;code to turn into &amp;amp;LU and to then resolve to Luxembourg for the title.&lt;/P&gt;
&lt;P&gt;Hope that makes sense,&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Sat, 22 Aug 2020 00:41:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/About-indirect-macro-variable-reference/m-p/678618#M23866</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-08-22T00:41:29Z</dc:date>
    </item>
  </channel>
</rss>

