In a SAS data step
if date2>date1 and not missing(date1);
In a SAS data step
if date2>date1 and not missing(date1);
@dr_101 wrote:
thank you very much for replying. will it set the distance between the two events at least one year? some ids have as little as 2 months gap between event 2 and event 1. I want to select only those with atleast 1 year gap.
thanks.
Your original post did not specify you wanted 1 year intervals.
A 1 year gap can be found via:
if date2>(date1+365) and not missing(date1);
Might need an adjustment if you really are concerned about leap years.
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.