I would like to build a proc report from my date, where it would calculate html / excel mean, median, sum etc. as a separate document. However, the problem is that from the table where I have POLICY_VINTAGE dates like this on below :
I have to (probably best create) the widetable with PROC TRANSPOSE. With this code,
PROC SQL;
create table POLICY_VINTAGE_WEEKLY as
select
POLICY_VINTAGE
,count(NRB) as NUMBER_POLICY
,2 as Run_Date
from PolisyEnd
where POLIS ="W"
group by
POLICY_VINTAGE
;
Quit;
proc transpose data = policy_vintage_weekly
name= Polisy_Active
out = work.policy_vintage_weekly;
by Run_Date;
id policy_vintage;
then the table looks like this:
When I try to build proc reports I get the error that POLICY_VINTAGE columns are missing, is it because of proc transpose? Do I have to choose all columns? How to make him calculate these indicators for me from the tabe
proc report data= _work.policy_vintage_weekly;
column POLICY_VINTAGE NUMBER_POLICY;
define NUMBER_POLICY/sum;
define NUMBER_POLICY/mean;
run;
ERROR: The variable POLICY_VINTAGE is not in _WORK.POLICY_VINTAGE_WEEKLY.
... View more