BookmarkSubscribeRSS Feed
0 Likes

Editor's note: this suggestion relates to the SAS code that is generated when you create a date prompt in SAS Enterprise Guide (project prompts or SAS stored processes).

 

I think it's a bug, but SAS may consider it a 'feature'...but when you specify a date as a month, you get this:

 

16         %LET Rcv_Date_min_end = 31Mar2018;
17         %LET Rcv_Date_max_end = 31Mar2018;
18         %LET Rcv_Date_min_label = Previous month;
19         %LET Rcv_Date_max_rel = M-1M;
20         %LET Rcv_Date_min = 01Mar2018;
21         %LET Rcv_Date_max = 01Mar2018;
22         %LET Rcv_Date_max_label = Previous month;
23         %LET Rcv_Date_min_rel = M-1M;

 

So why is the max date the same as the first of the month?  uh...no.  Line 21 should be this:

 

21         %LET Rcv_Date_max = 31Mar2018;

31 Comments
Tom
Super User
Super User

So looking at the documentation that @KatS_SAS posted it seems that when your interval longer than DAYS you want the range from dates from  "&Rcv_Date_min"d to "&Rcv_Date_max_end"d.

 

So the real problem is that when the interval is DAYS then the second macro variable is not defined. 

 

You could add some logic to your program to create it. Something like this:

 

data _null_;
  if not symexist('Rcv_Date_max_end') then
    call symputx('Rcv_Date_max_end',symget('Rcv_Date_max'),'G')
  ;
run;