<?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 Creating Macro Value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-Macro-Value/m-p/870721#M343926</link>
    <description>&lt;P&gt;Can you help me to Create a macro variable that will keep the largest value of NHITS from SASHELP.BASEBALL dataset.?&lt;/P&gt;</description>
    <pubDate>Thu, 20 Apr 2023 08:14:09 GMT</pubDate>
    <dc:creator>kindbe17</dc:creator>
    <dc:date>2023-04-20T08:14:09Z</dc:date>
    <item>
      <title>Creating Macro Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Macro-Value/m-p/870721#M343926</link>
      <description>&lt;P&gt;Can you help me to Create a macro variable that will keep the largest value of NHITS from SASHELP.BASEBALL dataset.?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 08:14:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Macro-Value/m-p/870721#M343926</guid>
      <dc:creator>kindbe17</dc:creator>
      <dc:date>2023-04-20T08:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Macro Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Macro-Value/m-p/870722#M343927</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
   select max(NHITS) 
   into :maxNHITS
   from sashelp.baseball
   ;
quit;

%put &amp;amp;maxNHITS.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Apr 2023 08:17:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Macro-Value/m-p/870722#M343927</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2023-04-20T08:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Macro Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Macro-Value/m-p/870724#M343928</link>
      <description>&lt;P&gt;Sir, is there any chance to solve this without using SQL ?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 08:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Macro-Value/m-p/870724#M343928</guid>
      <dc:creator>kindbe17</dc:creator>
      <dc:date>2023-04-20T08:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Macro Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Macro-Value/m-p/870725#M343929</link>
      <description>&lt;P&gt;Sure. But why?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have a preferred method?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a pure data step approach&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   set sashelp.baseball end = z;
   if NHITS &amp;gt; n then n = NHITS;
   if z then call symputx('maxNHITS', n);
   retain n;
run;

%put &amp;amp;maxNHITS.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Apr 2023 08:25:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Macro-Value/m-p/870725#M343929</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2023-04-20T08:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Macro Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Macro-Value/m-p/870732#M343931</link>
      <description>&lt;P&gt;Thank you so much Peter&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The SQL will be my next lesson that's why i asked you that.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 09:08:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Macro-Value/m-p/870732#M343931</guid>
      <dc:creator>kindbe17</dc:creator>
      <dc:date>2023-04-20T09:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Macro Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Macro-Value/m-p/870733#M343932</link>
      <description>&lt;P&gt;Instead of&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if NHITS &amp;gt; n then n = NHITS;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;n = max(n,nhits);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Apr 2023 09:13:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Macro-Value/m-p/870733#M343932</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-20T09:13:23Z</dc:date>
    </item>
  </channel>
</rss>

