The input for the code below is a dataset which contains one record per month. Also on the record is a variable indicating the quarter and year.
So, there is one record for every month, 3 records for a quarter, and 12 records for a year.
The code below is executed 3 times, once for month, once for quarter, once for year.
The idea is to have the denominator for each time period be accurate (1,3,or 12) so the average/month is correct. (Of course, in the case of a month execution, the total net_book_bal and the avg/month net_book_bal will be the same because it is divided by one).
Can someone please explain if I should be using pctn or pctsum, or colpct or rowpct. Nothing seems to work correctly. (Once again, the denominator should be the frequency (or the number of records) having the same value for a month, quarter, or year (1,3,12).
proc tabulate data=monthlevel;
class &period / descending ;
var glchgoff glrecovery glncl net_book_bal acct;
tables
net_book_bal=''*sum='$M Outstanding (Total)' *f=dollar21.2
net_book_bal=''*colpctn<&period.> ='$M Outstanding/month)*f=dollar21.2
,
&period.=' '
/ box="Measure" rtspace=25 row=float;
title1 "&titl1.";
run;
... View more