hello,
I will add to KSharp's solution the use of proc format so the title changes a little bit:
[pre]
data prod_sales;
input state $ pcode $ area $ month stock sale;
s=ifn(state in ('AP','KA'),1,2);
cards;
AP N79 HYD 1 40 20
TN N79 CHN 1 30 10
KA N79 BAN 1 45 20
AP N79 HYD 2 30 15
TN N79 CHN 2 10 10
KA N79 BAN 2 45 30
TN N79 CHN 3 20 10
KA N79 BAN 3 25 20
AP N79 HYD 3 20 15
;
proc format;
value s
1='AP,KA'
2='TN';
run;
proc report data=prod_sales nowd headline;
column s state pcode area month stock sale;
define state/order;
define area/order;
define pcode/order;
define s/group noprint;
break after state/summarize;
break after s/page;
compute after s;
line 65*'-';
line 'End of the report';
endcomp;
compute before _page_;
line 'This report belongs to: ' s s.;
endcomp;
run;
[/pre]
Marius