BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Poisonous_Snake
Calcite | Level 5
No, although there is a series of intervals, but these are intervals of A, so if these intervals are overlap, it means you use A continuously, (you can image that you are delivered candy A 4 times, but because the period of each candy A delivrance is overlap, so you eat candy A everyday sans cease), in that case, I know to know if the interval from the begin of A (the first time delivering candy A) to the end of A (the time you eat your last candy A) is cover interval of B (supposed that is a new kind of candy B).
In case of these intervals of A are disrupted, which means you have some seperated intervals of A, so when the interval of B fall in these intervals of A, it is not covered.
There is another case that only one interval or two intervals of A can cover interval of B.
And I only want to know if interval of B is completely covered by interval(s) of A.
Tom
Super User Tom
Super User

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.

 

 

Poisonous_Snake
Calcite | Level 5

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 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 17 replies
  • 3276 views
  • 0 likes
  • 4 in conversation