Hi,
i have two date variables asdtc and estdtc i want to get max(estdtc) when estdtc<=astdtc by subect ? any help would be appreciated
i have tried following
proc sql;
CASE WHEN substr(ESTDTC,1,10)<=ASTDTC THEN MAX(ESTDTC) group by subbjid; quit;
but it giving values of max(estdtc) by subject not based on estdtc<=astdtc
subjid estdtc astdtc
2008 2019-03-31T06:50 2019-04-02
2008 2019-03-28T19:02 2019-04-02
2008 2019-03-27T19:34 2019-04-02