Help using Base SAS procedures

sum by week and month

Reply
Contributor
Posts: 24

sum by week and month

 

 

AP002 3 23OCT2013

AP002 4 01NOV2013

AP002 5 01NOV2013

AP002 6 14AUG2014

AP002 7 05SEP2014

 

I am trying to sum the number of dates by week and by month. This is the format for my dates and IDs.....

Super User
Posts: 10,500

Re: sum by week and month

What would you expect the output to look like given that input?

is the result to be a data set or a report?

Contributor
Posts: 24

Re: sum by week and month

So those dates are each time a person made a call. I want to total the number of dates per id every four weeks. (or analyze the change by every four weeks)

Super User
Posts: 9,678

Re: sum by week and month

Add two format into two proc means :

 

 

data have;
input id $ n date date9.;
format date date9.;
cards;
AP002 3 23OCT2013
AP002 4 04NOV2013
AP002 5 07NOV2013
AP002 6 14AUG2014
AP002 7 05SEP2014
;
run;


proc summary data=have;
by id date;
var n;
format date monyy.;
output out=want1 sum=sum_n;
run;


proc summary data=have;
by id date;
var n;
format date weekv5.;
output out=want2 sum=sum_n;
run;
Ask a Question
Discussion stats
  • 3 replies
  • 372 views
  • 0 likes
  • 3 in conversation