DATA Step, Macro, Functions and more

How to run a single report instead two

Reply
Super Contributor
Posts: 673

How to run a single report instead two

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.
SAS Super FREQ
Posts: 8,864

Re: How to run a single report instead two

Hi:
Just wondering whether this is a new set of reports or whether this is related to your previous posting?
http://support.sas.com/forums/thread.jspa?messageID=20499倓

cynthia
Super Contributor
Super Contributor
Posts: 3,174

Re: How to run a single report instead two

You have explained nothing about how and where you wish to generate the output reports - PDF, web, etc. -- please share more info (ideally your SAS code) which renders some output, if no more than to explain what / where you would like the output to be delivered?

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 2 replies
  • 118 views
  • 0 likes
  • 3 in conversation