So, the following two macros work: --To return a specified number of observations, this one works properly %macro homework3_3 (obs=); options nodate nonumber; title "LISTING PRODUCED ON: &sysday, &sysdate9. at &systime"; proc print data=hw3c.stocks (obs=&obs); run; %mend homework3_3; %homework3_3 (obs=5); --To return values within a date range, and it works properly as well %macro daterange(begindate,enddate); %let begindate = "&begindate"d; %let enddate = "&enddate"d; proc print data=hw3c.stocks; where date between &begindate and &enddate; run; %mend daterange; %daterange(05Jan2013,20Jan2013) However, when I combine these macros with the code below: %macro PRINT_N(begindate,enddate,obs=); %let begindate = "&begindate"d; %let enddate = "&enddate"d; proc print data=hw3c.stocks (obs=&obs); where date between &begindate and &enddate; run; %mend PRINT_N; %daterange(05Jan2013,20Jan2013,obs=5) I get an error message: "ERROR: The keyword parameter OBS was not defined with the macro." 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. What am I doing wrong? Thanks! Matt
... View more