Count Members as of 15th of each month

Reply
Occasional Contributor
Posts: 16

Count Members as of 15th of each month


I have done a data step that would count member months for past 3 years. But I have been asked to make sure that my query does member month count as of 15th of each month...and I got suddenly confused and not sure of my code.

Here is what I am traying to achieve.

I have eligibility file for members , meaning all 3 year worth of data. I need to check if a member was active each month on the 15th of each month, for past 3 years. If so then he gets count of 1 for been active.

I have done something like this ,where effdt/end date in the data step is a field from the data set.

Data a;

     array mos [1:37] &monthlist;

set mbrcov ;

mcount=0

do I=1 to 37;

if intnx('month', 01mar10,I-1) > effdt and

intnx('month', 01mar10,I-1) < enddt then mos=1;

else mos=0;

mcount=mcount+mos;

end;

run;

How do I modify this so I check that is active on the 15th of each month? I think answer is right there in front of me,but I just don't see it after looking at it soo long. Thanks for advise.

Super User
Posts: 10,500

Re: Count Members as of 15th of each month

I think you need to provide a little information about the structure of the data.

You may also want to look at the alignment option for intnx which can allow you compare to the same day of the month.

Ask a Question
Discussion stats
  • 1 reply
  • 154 views
  • 0 likes
  • 2 in conversation