1
votes

I am a beginner in SAS, and I have a dummy question to ask.

I would like to pull member information based on their enrollment. I want year 2010 members but I don't want to restrict myself into ineligible_date=20100101 and eligible_date=20101231 because some people can enroll in 2009 and leave in 2014 etc. Can anyone tell me how to set up my date range?

The raw data looks like

ID       Eligibility  Ineligibility
123      8/1/2012     12/31/2012
1234     1/1/1997     8/31/2011
12345    4/1/2001     2/28/2010
1        7/1/2008     1/1/2010
2        5/1/2000     3/31/2010
3        11/1/2009    4/30/2013
456      9/1/2007     11/30/2009
789      3/1/1998     12/31/2010
1234567  2/1/2012     5/31/2012
1010     1/1/2010     1/1/2010

I would like the data to look like

ID     Eligibility  Ineligibility
1234   1/1/1997     8/31/2011
12345  4/1/2001     2/28/2010
2      5/1/2000     3/31/2010
3      11/1/2009    4/30/2013
789    3/1/1998     12/31/2010
2
Please give examples of data and what you want returned. Your question is ambiguous because you talk about both years and dates.Gordon Linoff

2 Answers

0
votes

Does this work?

(ineligible_date >= 20100101 AND eligible_date <= 20101231) OR
(ineligible_date IS NULL AND eligible_date <= 20101231)
0
votes

Based on your data the following logic can get what you want

if eligibility < '01jan2010'd   and Ineligibility > '01jan2010'd  ;