I can see two methods to fix this.
One is to first collapse your A intervals so that they do represent separate intervals. Then loop over them and check if B falls in any of them.
The other is to brute force it. Make a large temporary array with one element for each possible day. Process the A records to fill in the days each covers. Then loop of the days of the B interval and see if all of the days are covered.
I think about collapse the intervals of A into only one interval of A (if they are overlap), so now I'm trying to do it, although there are some problems (because there are more conditions for A and B), but that's the only way I can do right now.
For your second solution, I don't really understand it.
Thank you for helping me hihi
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.