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
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.