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 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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