<?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 Macro variable creation with %global in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-creation-with-global/m-p/717978#M222117</link>
    <description>&lt;P&gt;Taking an example from a SAS book:&amp;nbsp; The code is: %global %scan(&amp;amp;varlist, &amp;amp;wrd)max;&lt;/P&gt;&lt;P&gt;Say, %scan(&amp;amp;varlist, &amp;amp;wrd)&amp;nbsp;evaluates to 'age'.&lt;/P&gt;&lt;P&gt;The %global statement then creates the macro variable 'agemax'.&lt;/P&gt;&lt;P&gt;I cannot find documentation that tells me that this %global statement concatenates the results of %scan with 'max'.&amp;nbsp; Can anybody point me to that?&lt;/P&gt;</description>
    <pubDate>Tue, 09 Feb 2021 18:59:48 GMT</pubDate>
    <dc:creator>MBKo</dc:creator>
    <dc:date>2021-02-09T18:59:48Z</dc:date>
    <item>
      <title>Macro variable creation with %global</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-creation-with-global/m-p/717978#M222117</link>
      <description>&lt;P&gt;Taking an example from a SAS book:&amp;nbsp; The code is: %global %scan(&amp;amp;varlist, &amp;amp;wrd)max;&lt;/P&gt;&lt;P&gt;Say, %scan(&amp;amp;varlist, &amp;amp;wrd)&amp;nbsp;evaluates to 'age'.&lt;/P&gt;&lt;P&gt;The %global statement then creates the macro variable 'agemax'.&lt;/P&gt;&lt;P&gt;I cannot find documentation that tells me that this %global statement concatenates the results of %scan with 'max'.&amp;nbsp; Can anybody point me to that?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 18:59:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-creation-with-global/m-p/717978#M222117</guid>
      <dc:creator>MBKo</dc:creator>
      <dc:date>2021-02-09T18:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable creation with %global</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-creation-with-global/m-p/717983#M222119</link>
      <description>&lt;P&gt;In macro language, this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%scan(&amp;amp;varlist, &amp;amp;wrd)max&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;is&lt;/EM&gt; the concatenation.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 19:21:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-creation-with-global/m-p/717983#M222119</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-02-09T19:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable creation with %global</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-creation-with-global/m-p/717986#M222121</link>
      <description>&lt;P&gt;Once the macro processor has finished processing something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%scan(age sex race,1)max&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The resulting string "agemax" is then used in evaluating the larger expression it is part of.&amp;nbsp; So&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%global %scan(age sex race,1)max ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Becomes&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%global agemax ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;This type of text substitution is the exactly what "macro processors" are used for in any language, whether it is SAS , assembly or C.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 19:39:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-creation-with-global/m-p/717986#M222121</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-09T19:39:18Z</dc:date>
    </item>
  </channel>
</rss>

