There is not a function that will do that directly you will have to take your rules and code each one, for example:
data test; do i=0 to 100; y=i*0.05; x=i+0.01; output; end; run; data test; set test end=last; x_obs=7.01; y_obs=0.35; if last then reflabel='.3'; run; data demo; format date weekdatx. sat_start_of_week sat_end_of_week begining_month_date ending_month_date date9.; do date='01jan2016'd to '31mar2016'd; sat_start_of_week=intnx('week.7',date,0,'b'); sat_end_of_week=intnx('week.7',date,0,'e'); begining_month_date=intnx('month',date,0,'b'); ending_month_date=intnx('month',date,0,'e'); wdb=weekday(begining_month_date); wde=weekday(ending_month_date); if wdb =6 then begin_month=begining_month_date+1; if wdb =2 then begin_month=begining_month_date-2; if wde eq 1 then ending_month=ending_month_date-2; if wde eq 2 then ending_month=ending_month_date-3; output; end; drop begining_month_date ending_month_date; run; proc print; format begin_month ending_month date.; run;
... View more