I would agree there. From my side I have to store a copy of the dataset for separate validation, so the dataset should resemble the output as much as possible. Hence we do all the calculations up front: data have; length Market_name Channel_Summary $200 total_accts_m1 8 brkt brkb $1; infile datalines dlm=","; input Market_name $ Channel_Summary $ total_accts_m1 brkt $ brkb $; datalines; Greater Philadelphia,Touchpoint,2,t,b New England South,Touchpoint,7,t,b Western/Central Pennsylvania,Touchpoint,1,t,b _Incomplete Information,Branch Intranet,1,t,b _Incomplete Information,Touchpoint,2,t,b ; run; proc sql; create table WANT as select MARKET_NAME, CHANNEL_SUMMARY, TOTAL_ACCTS_M1 from WORK.HAVE union all select "" as MARKET_NAME, "Grand Total Touchpoint" as CHANNEL_SUMMARY, SUM(TOTAL_ACCTS_M1) as TOTAL_ACCTS_M1 from (select * from WORK.HAVE where CHANNEL_SUMMARY="Touchpoint") union all select "" as MARKET_NAME, "Grand Total Branch Internet" as CHANNEL_SUMMARY, SUM(TOTAL_ACCTS_M1) as TOTAL_ACCTS_M1 from (select * from WORK.HAVE where CHANNEL_SUMMARY="Branch Intranet"); quit; ods pdf file="s:\temp\rob\out.pdf"; proc report data=want style=statistical nowd; columns market_name channel_summary total_accts_m1; run; ods pdf close;
... View more