How to generate a single report instead two?
/** grouping yearly****/
proc sql noprint;
create table rpt3a as
select distinct terrid,region,bsm, md_zip,PHYS_ADDRESS1,PHYSICIAN_ADDRESS2,pat_seq_id1,phys_city,md_state,physician_name, sum(total_scripts) as T_yr, year, productgroup
from prescriberdata_v2
group by terrid,region, md_zip, bsm,PHYS_ADDRESS1,PHYSICIAN_ADDRESS2,physician_name ,pat_seq_id1, year, productgroup,md_zip,phys_city,md_state;
quit;
Generate report at year level:
proc report data=rpt3a nowd NOWINDOWS HEADLINE MISSING;
COLUMN terrid region bsm md_zip physician_name PHYS_ADDRESS1 PHYSICIAN_ADDRESS2 phys_city md_state pat_seq_id1 t_yr,year, productgroup ;
---SAS code follows---
run;
/** grouping at year_month****/
proc sql noprint;
create table rpt3b as
select distinct terrid,region,bsm, md_zip,PHYS_ADDRESS1,PHYSICIAN_ADDRESS2,pat_seq_id1,phys_city,md_state,physician_name, sum(total_scripts) as T_yr_m, year_month, productgroup
from prescriberdata_v2
group by terrid,region, md_zip, bsm,PHYS_ADDRESS1,PHYSICIAN_ADDRESS2,physician_name ,pat_seq_id1, year_month, productgroup,md_zip,phys_city,md_state;;
quit;
Generate report at year_month level:
proc report data=rpt3b nowd NOWINDOWS HEADLINE MISSING;
COLUMN terrid region bsm md_zip physician_name PHYS_ADDRESS1 PHYSICIAN_ADDRESS2 phys_city md_state pat_seq_id1 t_yr_m,year_month, productgroup;
---SAS code Follows---
run;
The final report I copy the second report and paste it in the first report.
I'm wondering if there is a way to do in a single report.
This will save time and manual errors.