If I understand you want to do something you have defined when the month and year match between your two variables O_date and AppStatusDate. But then you show values for those variables where the month and year do not match.
Can you provide and actual rule for how that match is supposed to take place?
Also, since you are apparently using TWO data sets then the structure of those sets is important. For instance which sets to the variables "Application number" (not a valid SAS name generally) and Number come from?
It would be best to post 1) all of the code not that pseudocode with illegal syntax, 2) examples of records from each data set. Do not paste pictures or Excel copy & paste. Data should be in form of a data step so that we can actually recreate useable data. Anything pasted from Excel requires us to guess about the actual variable type and name.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.