Selvi... your questions:
1) Do we apply stylelike bold,,font to line " " within compute block.
-- yes you can either do this:[pre]
proc report data=whatever nowd
style(lines)={font_weight=bold}
style(summary)={font_weight=bold}
style(header)={background=yellow};[/pre]
on the PROC REPORT statement or you can do this (change the compute block lines):
[pre]
compute after /
style={font_weight=bold};
*** more code and LINE stmts;
endcomp;[/pre] OR if you wanted the BREAK/RBREAK styles to be different, you could do this:[pre]
break after brkvar / summarize
style={font_weight=bold};
rbreak after / summarize
style={font_weight=bold};[/pre]
2) break after rank_i / ol summarize skip; - This statement is working good in saslist. but in my PDF i didn't get the same output as in SASLIST.
--the SUMMARIZE will work in both LISTING and PDF. The SKIP will NOT work in PDF, RTF or HTML. This is explained in this Tech Support note:
http://support.sas.com/techsup/unotes/SN/002/002549.html and several workarounds are listed here (including one for skip):
http://support.sas.com/rnd/base/topics/templateFAQ/repoption.html
3) In the above code, the line @37 is coming after the final summarization. But i need it before the final summarization. ( before 12 MONTH TOTAL).
-- In the PROC REPORT documentation, there is a section called "How PROC REPORT Builds a Report". In that section, it explains how PROC REPORT works and that "PROC REPORT first constructs the break lines that are created with the BREAK or RBREAK statement or with options in the BREAK window. If there is a compute block attached to the break, then PROC REPORT then executes the statements in the compute block." This means that your summary line from the RBREAK AFTER will come before any LINE statments in the COMPUTE AFTER.
The other issue that you're going to have with the technique shown in your compute block is that the @37 will work in the LISTING destination, but it will be difficult to make things line up in PDF the way you want.
I see 2 overall problems with this approach: [pre]
Region Product Sales
Asia Slippers $13,000
Asia Boots $25,000
Asia Casual $40,000
Pacific Slippers $15,000
Pacific Boots $20,000
Pacific Casual $30,000
Asia Slippers $13,000[/pre]
1) unless you made your SALES equivalent variables display variables, it would be impossible to prevent the second "$13,000" from getting added into the summary line.
2) if you are somehow trying to bypass PROC REPORT's summary process by inserting a line above the PROC REPORT summary line -- I don't actually think you can do this with PROC REPORT.
I wonder if you have already created summary information with PROC MEANS or the DATA step that you are trying to get into some special company format? But at this point, I think you've probably moved out of the world of PROC REPORT unless you want to rethink how you are producing the report from your data.
Try this code. It uses sashelp.shoes and proc means creates a summary dataset that has _TYPE_=0 as the first obs and the "summary" line:[pre]
ods listing;
proc means data=sashelp.shoes;
class region;
var sales;
output out=work.tot n=salcnt sum=salsum ;
run;
ods pdf file='c:\temp\selvi.pdf';
proc print data=work.tot;
title 'output from proc means';
run;
proc report data=sashelp.shoes nowd
style(summary)={font_weight=bold font_style=roman};
title 'summary report from proc report';
column region sales sales=salcnt sales=salpct;
define region / group;
define sales / n f=comma6. 'Count';
define salcnt / sum;
define salpct / pctsum f=percent9.2 'Percent';
rbreak before / summarize;
rbreak after / summarize;
run;
ods pdf close;
[/pre]
I can make PROC REPORT duplicate the output from PROC MEANS (with a summary at the top.) But, for the PROC REPORT, I am NOT using the output from PROC MEANS, but am having PROC REPORT do for SASHELP.SHOES the equivalent of what PROC MEANS does. PLUS, I can have PROC REPORT calculate the PCTSUM for me, as well AND PROC REPORT can put the summary line both above and below the report lines. So, by rethinking your report, I mean using PROC REPORT for the grouping and summarizing, not just displaying the detail lines.
However, if you feel that you must still produce the report from your data because it is already in the form that you want/need and that you must insert something before the last line on the report, then you may have to consider switching over to the DATA step. [pre]
ods listing;
proc means data=sashelp.shoes;
class region;
var sales;
output out=work.tot n=salcnt sum=salsum ;
run;
proc print data=work.tot;
run;
ods pdf file='c:\temp\selvi.pdf';
data _null_;
set work.tot end=eof;
retain holdreg holdtot holdsum;
file print ods=(variables=(_type_ Region salcnt salsum));
if _type_ = 0 then do;
holdreg = Region;
holdtot = salcnt;
holdsum = salsum;
Region = 'Before';
end;
put @1 _type_ @2 Region @3 salcnt @4 salsum;
if eof then do;
_type_ = 88;
Region = 'Insert';
salcnt = 888;
salsum = 888;
put @1 _type_ @2 Region @3 salcnt @4 salsum;
_type_ = 99;
put @1 _type_ @2 'Repeat' @3 holdtot @4 holdsum;
end;
run;
ods _all_ close;
[/pre]
At this point, I feel that I must be missing something about your data that dictates the approach that you've chosen. Your best bet might be to contact Tech Support so they can look at YOUR real data and help you determine the best method for resolving ALL the issues that you have with your report production. They can help you figure out whether you should stick with PROC REPORT or switch to DATA _NULL_ and can help you with the syntax of both for your specific destination LISTING or PDF.
Good luck!
cynthia