I have read similar questions already answered in this community but could not find the exact one I want.
I currently have a dataset like
ID error_start error_end
10 2007 2010
30 2005 2008
50 2009 2011
From the above dataset, I want to make a dataset (year from 2003 to 2012) like the below...
if there is an error between the above interval, error=1; else error=0;
I cannot make a code for if there is an error between the start date and the end date, error is 1, otherwise 0.
Please share your wisdom 🙂 Thank you!
ID error Year
10 0 2003
10 0 2004
10 0 2005
10 0 2006
10 1 2007
10 1 2008
10 1 2009
10 1 2010
10 0 2011
10 0 2012
30 0 2003
30 0 2004
30 1 2005
30 1 2006
30 1 2007
30 1 2008
30 0 2009
30 0 2010
30 0 2011
30 0 2012
50 0 2003
50 0 2004
50 0 2005
50 0 2006
50 0 2007
50 0 2008
50 1 2009
50 1 2010
50 1 2011
50 0 2012
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.