Das kommt darauf an, wie man den Wochenabstand definiert:
data have;
format datum e8601da10.;
do datum = '07nov2018'd to '05dec2018'd;
output;
end;
run;
%let startdate=%sysfunc(inputn(2018-11-07,yymmdd10.));
data want1;
set have;
where &startdate + 7 <= datum < &startdate. + 21;
run;
data want2;
set have;
where intck('week',&startdate.,datum) in (1,2);
run;
data want3;
set have;
where intck('week',&startdate.,datum,'c') in (1,2);
run;
Variante 1 und Variante 3 liefern hier das gleiche Ergebnis.
... View more