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
Can you post some sample of your data? Makes it much easier to provide a usable code answer.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.