<?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: Macros in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Macros/m-p/563523#M10897</link>
    <description>&lt;P&gt;ThankYou! Makes sense ! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jun 2019 13:56:38 GMT</pubDate>
    <dc:creator>mauley</dc:creator>
    <dc:date>2019-06-04T13:56:38Z</dc:date>
    <item>
      <title>Macros</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macros/m-p/563514#M10893</link>
      <description>&lt;P&gt;I am struggling to use macro variables within a macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%LET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Run_dt = 31Mar2019;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%LET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Report=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%SYSFUNC&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(INTNX(MONTH,"&amp;amp;run_dt."d,0,e),DATE9.);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%LET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; start=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%SYSFUNC&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(INTNX(MONTH,"&amp;amp;run_dt."d,-11,e),DATE9.);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;Report. &amp;amp;start.;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;The Log will show &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;31MAR2019 30APR2018&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I would like to do this within a Macro (there will be part of something larger within the macro I'm not doing it without reason :))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like this;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%Macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;STRONG&gt;&lt;I&gt;wont_work&lt;/I&gt;&lt;/STRONG&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%LET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Report=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%SYSFUNC&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(INTNX(MONTH,"&amp;amp;run_dt."d,0,e),DATE9.);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%LET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; start=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%SYSFUNC&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(INTNX(MONTH,"&amp;amp;run_dt."d,-11,e),DATE9.);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%Mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; wont_work;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;month_prov&lt;/I&gt;&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This as I'm sure you know doesn't give me the results I want!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please can someone explain my error to me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thankyou!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 13:30:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macros/m-p/563514#M10893</guid>
      <dc:creator>mauley</dc:creator>
      <dc:date>2019-06-04T13:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Macros</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macros/m-p/563521#M10896</link>
      <description>&lt;P&gt;Make these two macro variable Global .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET Run_dt = 31Mar2019;

%Macro wont_work;
%global Report start ;
%LET Report=%SYSFUNC(INTNX(MONTH,"&amp;amp;run_dt."d,0,e),DATE9.);
%LET start=%SYSFUNC(INTNX(MONTH,"&amp;amp;run_dt."d,-11,e),DATE9.);
%Mend wont_work;

 

%wont_work

%put &amp;amp;Report. &amp;amp;start.;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Jun 2019 13:50:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macros/m-p/563521#M10896</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-06-04T13:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Macros</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macros/m-p/563523#M10897</link>
      <description>&lt;P&gt;ThankYou! Makes sense ! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 13:56:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macros/m-p/563523#M10897</guid>
      <dc:creator>mauley</dc:creator>
      <dc:date>2019-06-04T13:56:38Z</dc:date>
    </item>
  </channel>
</rss>

