BookmarkSubscribeRSS Feed
Rose
Calcite | Level 5

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..

4 REPLIES 4
Ksharp
Super User

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.

Smiley Happy

Ksharp

Rose
Calcite | Level 5

Thanks Ksharp..

My source dataset is like

Col1Col2Col3
DIV Aa1
b2
DIV Ba2
b2
DIV Ca5
b5

I want the report to be in the form

DIV Aa1
b2
Total3
DIV Ba2
b2
Total4
DIV CTotal10

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..

Cynthia_sas
SAS Super FREQ

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

Rose
Calcite | Level 5

Thanks Cynthia for the info.. I changed my source dataset accordingly... Smiley Happy

Thank u Ksharp Smiley Happy

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 4376 views
  • 6 likes
  • 3 in conversation