Hi,
I have a requirement to hide 2 rows in my report, but I need to show the total of these records using 'rbreak summarize' . Since I have to show the total in the report I am not able to delete these records from my source dataset. Is there any option in proc report like
if col1 = 'SP" then delete;
Please help..
You need to use computed column to hiden these two row of especial column and use noprint for this especial column.
The best way is to post some data and output you need, then Cynthia is able to do it with happiness.
Of course.I can do it also.But I recommend Cynthia who is better.
Ksharp
Thanks Ksharp..
My source dataset is like
Col1 | Col2 | Col3 |
DIV A | a | 1 |
b | 2 | |
DIV B | a | 2 |
b | 2 | |
DIV C | a | 5 |
b | 5 |
I want the report to be in the form
DIV A | a | 1 |
b | 2 | |
Total | 3 | |
DIV B | a | 2 |
b | 2 | |
Total | 4 | |
DIV C | Total | 10 |
i.e., i want to delete the 2 rows corresponding to DIV C and print the Total only..
Hope I am clear with the requirement nw..
Hi:
I appreciate Ksharp's confidence in my ability to code PROC REPORT, however, I cannot code anything counter to the way that PROC REPORT wants to operate.
The bottom line is that PROC REPORT does not allow you to delete report rows. If report is doing a detail report, with summary lines, you can either have summary lines or not --- but you cannot delete the detail lines and only show the summary lines. To collapse the detail lines, you would move into the world of summary report, but given your data, you are generating a detail report that contains summary lines.
PROC REPORT does allow you to hide report columns, using the NOPRINT option. But if you want to generate the TOTAL line with PROC REPORT, for each division, then each division will be treated the same way and you cannot show the report rows for Div A and Div B and suppress them for Div C. You might be able to pre-process your data somewhat to do the report you want, but PROC REPORT will not do it "out of the box".
cynthia
Thanks Cynthia for the info.. I changed my source dataset accordingly...
Thank u Ksharp
.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.