Hi:
In fact, PROC REPORT -can- produce this report without restructuring the data because of the ability to use the NOPRINT options. The PRD_GRP and PRD_SUBGROUP items can be defined as GROUP or ORDER (with NOPRINT), the LINE statement will be able to use those 2 items in a COMPUTE BEFORE group.
An example, using differently named variables is shown below.
cynthia
[pre]
data repdata;
length grpvar subgrp desc $20;
infile datalines dlm="," dsd;
input grpvar $ subgrp $ desc $ amount;
return;
datalines;
"GROUP1", "SUBGRP1","One", 234
"GROUP1", "SUBGRP1","Two", 345
"GROUP1", "SUBGRP1","Three", 678
"GROUP2", "SUBGRP2","Ten", 911
"GROUP2", "SUBGRP2","Eleven", 345
"GROUP2", "SUBGRP2","Twelve", 987
"GROUP2", "SUBGRP2","Something", 432
;
run;
ods listing close;
ods html file='c:\temp\repdata.html' style=sasweb;
proc report data=repdata nowd;
column grpvar subgrp desc amount;
define grpvar / order noprint;
define subgrp / order noprint ;
define desc / order order=data 'Item';
define amount / sum 'Loan Amount';
rbreak after / summarize;
compute after;
desc = 'Total';
endcomp;
compute before subgrp /
style=Header{just=l};
line grpvar $20.;
line subgrp $20.;
endcomp;
run;
ods html close;
[/pre]