DATA Step, Macro, Functions and more

sql or report

Super Contributor
Posts: 713

sql or report

The data set has the following variables:

Last_Name First_Name City State Zip GHTM date drug mg_dispensed has the values from Jan 2008 and is in the format date9.
2.drug has two categories:
Competitor and Nordi.
3.Mg_dispensed is the mg dispensed for drug numeric.

Last_Name First_Name City State Zip GHTM Q1_09_Total_mg Q1_09_Nordi Q2_09_Total_mg Q2_09_Nordi....Q1_08_Total_mg Q1_08_Nordi_mg
John Peter abc pq 12345 JSEQ 36542 24.3%

in the output:

Q1_09_Total_mg is the total mg dispensed by the physician i.e sum of competitor and Nordi in the first qtr of 09.
Q1_09_Nordi is the total nordi share in the first qtr of 09.

Actually , the quarters appear from current qtr ,(2009 second qtr) to 2008 all four qtrs in the report.
Super Contributor
Super Contributor
Posts: 3,176

Re: sql or report

From your SUBJECT, it appears that you are looking for feedback on which approach to take - that being "PROC SQL or PROC REPORT"?

Of course, a DATA step approach allows ultimate flexibility, however a combination of PROC TRANSPOSE and PROC REPORT (or maybe only PROC REPORT with ACROSS, but maybe not with those desired column headings you show) would do the job.

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation