Hi Bruce123 One step to approach this is to use Proc TRANSPOSE to restructure your data, and then use some macro logic to build the Proc REPORT code, see sample below. data have; do group = "A", "B", "C"; do year = 2000 to 2013; toDate = mdy(1, 1, year); performance = ceil( rand("uniform") * 1000 ); output; end; end; format toDate date9.; run; %macro myReport(startYear=2009, endYear=2012); %local i; proc transpose data=have out=want prefix=performance_ ; where year between &startYear and &endYear; by group; id year; var performance; run; title "Performance from &startYear to &endYear"; proc report data=want nowindows; column group performance_&endYear %do i = &startYear %to (&endYear -1); performance_&i %end; ; define group / display; define performance_&endYear / display "Performance"; %do i = &startYear %to (&endYear -1); define performance_&i / display /* "Performance &i" */; %end; run; title; %mend; %myReport()
... View more