<?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: 2 &amp;quot;sub-macros&amp;quot; work, but I'm having trouble combining them... in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/2-quot-sub-macros-quot-work-but-I-m-having-trouble-combining/m-p/118949#M24496</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow.&amp;nbsp; That's embarrassing.&amp;nbsp; Thank you!&amp;nbsp; (Feels rather silly to make a mistake like that!)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 23 Feb 2013 03:42:34 GMT</pubDate>
    <dc:creator>batnet</dc:creator>
    <dc:date>2013-02-23T03:42:34Z</dc:date>
    <item>
      <title>2 "sub-macros" work, but I'm having trouble combining them...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-quot-sub-macros-quot-work-but-I-m-having-trouble-combining/m-p/118947#M24494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, the following two macros work:&lt;/P&gt;&lt;P&gt;--&lt;EM&gt;To return a specified number of observations, this one works properly&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;%macro homework3_3 (obs=);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; options nodate nonumber;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; title "LISTING PRODUCED ON: &amp;amp;sysday, &amp;amp;sysdate9. at &amp;amp;systime";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc print data=hw3c.stocks (obs=&amp;amp;obs);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;%mend homework3_3;&lt;/P&gt;&lt;P&gt;%homework3_3 (obs=5);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;--To return values within a date range, and it works properly as well&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;%macro daterange(begindate,enddate);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let begindate = "&amp;amp;begindate"d;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let enddate = "&amp;amp;enddate"d;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc print data=hw3c.stocks; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where date between &amp;amp;begindate and &amp;amp;enddate; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;%mend daterange;&lt;/P&gt;&lt;P&gt;%daterange(05Jan2013,20Jan2013)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;However, when I combine these macros with the code below:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;%macro PRINT_N(begindate,enddate,obs=);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let begindate = "&amp;amp;begindate"d;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let enddate = "&amp;amp;enddate"d;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc print data=hw3c.stocks (obs=&amp;amp;obs); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where date between &amp;amp;begindate and &amp;amp;enddate; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %mend PRINT_N;&lt;/P&gt;&lt;P&gt;%daterange(05Jan2013,20Jan2013,obs=5)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get an error message: "ERROR: The keyword parameter OBS was not defined with the macro."&amp;nbsp; I don't understand why, because I defined OBS in the same way in both this Macro and in the first Macro; it worked in Macro #1 but not in Macro #3.&amp;nbsp; What am I doing wrong?&amp;nbsp; Thanks!&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2013 21:33:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-quot-sub-macros-quot-work-but-I-m-having-trouble-combining/m-p/118947#M24494</guid>
      <dc:creator>batnet</dc:creator>
      <dc:date>2013-02-22T21:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: 2 "sub-macros" work, but I'm having trouble combining them...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-quot-sub-macros-quot-work-but-I-m-having-trouble-combining/m-p/118948#M24495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;changing&lt;/P&gt;&lt;P style="font-size: 12.800002098083496px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12.800002098083496px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%daterange(05Jan2013,20Jan2013,obs=5)&lt;/P&gt;&lt;P style="font-size: 12.800002098083496px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;to&lt;/P&gt;&lt;P style="font-size: 12.800002098083496px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.800002098083496px; background-color: #ffffff;"&gt;%print_n(05Jan2013,20Jan2013,obs=5)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2013 22:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-quot-sub-macros-quot-work-but-I-m-having-trouble-combining/m-p/118948#M24495</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2013-02-22T22:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: 2 "sub-macros" work, but I'm having trouble combining them...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-quot-sub-macros-quot-work-but-I-m-having-trouble-combining/m-p/118949#M24496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow.&amp;nbsp; That's embarrassing.&amp;nbsp; Thank you!&amp;nbsp; (Feels rather silly to make a mistake like that!)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Feb 2013 03:42:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-quot-sub-macros-quot-work-but-I-m-having-trouble-combining/m-p/118949#M24496</guid>
      <dc:creator>batnet</dc:creator>
      <dc:date>2013-02-23T03:42:34Z</dc:date>
    </item>
  </channel>
</rss>

