Help using Base SAS procedures

how to delete/hide rows in a report using proc report?

Reply
Occasional Contributor
Posts: 10

how to delete/hide rows in a report using proc report?

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

Super User
Posts: 9,662

how to delete/hide rows in a report using proc report?

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

Occasional Contributor
Posts: 10

how to delete/hide rows in a report using proc report?

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

SAS Super FREQ
Posts: 8,739

how to delete/hide rows in a report using proc report?

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

Occasional Contributor
Posts: 10

how to delete/hide rows in a report using proc report?

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

Thank u Ksharp Smiley Happy

Ask a Question
Discussion stats
  • 4 replies
  • 1202 views
  • 6 likes
  • 3 in conversation