Your statement works perfect to me bother data step and proc sql.
97 data test;
98 format AdmitDT yymmddn8.;
99 do i = 1 to 365;
100 AdmitDT = today() - i;
101 output;
102 end;
103 run;
NOTE: The data set WORK.TEST has 365 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
104
105 data t;
106 set test;
107 if AdmitDT > INTNX('Day', Today(), -181);
108 run;
NOTE: There were 365 observations read from the data set WORK.TEST.
NOTE: The data set WORK.T has 180 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
109
110 proc sql;
111 create table t1 as
112 select * from test
113 where AdmitDT > INTNX('Day', Today(), -181);
NOTE: Table WORK.T1 created, with 180 rows and 2 columns.
114 quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds