r.activdate <= intnx('days', "&datepmt."d, -90)
It is asking for 90 days and nothing related to "weeks".
Week can have multiple definitions as to start day of the week, how the transition across calendar years gets treated and such.
Look at the WEEK function documentation and the U, V and W descriptor options for example.
Without knowing which definition you use can't say. Also I see nothing that bears on a "week ending" to clarify.
You could have ANY number of days, given that you restrict activdate to
and r.activdate <= intnx('days', "&datepmt."d, -90)
This puts a ceiling on acceptable activdate values, but no minimum.
Now, you could find the minimum activdate found in the data, so you would know the number of possible date values. But you would als have to know the maximum date value found to get the RANGE. And do a frequency of activdate to get the actual NUMBER of unique date values.
So what do you actually want?
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.