data have;
input Person_ID $ date Date9. Sport $ ;
format date date9.;
datalines;
1234 20FEB2020 Football
1234 20FEB2020 Basketball
1234 25FEB2020 Ski
1234 07SEP2020 Football
How would I create a variable that says 'Y' for line 1 and 4 because there is at least a 6 month difference between the two days; and 'Y' for line 3 because it is a different type of sport? I want 'N' if it is on the same day and has a different sport, 'Y' if it is on a different day and a different sport, and 'Y' if the same (or different) sport is played with a 6 month difference.