BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

In a SAS data step

 

if date2>date1 and not missing(date1);
--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

In a SAS data step

 

if date2>date1 and not missing(date1);
--
Paige Miller
PaigeMiller
Diamond | Level 26

@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. 

--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 552 views
  • 0 likes
  • 2 in conversation