The SAS Output Delivery System and reporting techniques

Proc report - break condtionally ?

Reply
New Contributor
Posts: 2

Proc report - break condtionally ?

[ Edited ]

Hello

I am currently using ODS and break statement to create report below

define fromlist/group 'List Type';
define rmailing_month/group 'Mailing Month' ;
define virtual_mth/group 'Virtual Month' noprint ;

define segment/display 'Segments';
define impression/analysis 'Impression';
break before rmailing_month / dol summarize suppress ;

 

 

 
List TypeMailing MonthSegmentsImpression
   14009
1- All Lists201401Overall14009
   12992
 201501Ballots all426
  Regular8339
  Test12108
  Test22119
   14339
 201402Overall14339
   14145
 201502Ballots all389
  Regular9109
  Test12322
  Test22325

 

I want to make 2 changes as per my client request :

Changes:

(1) For data associated with months 201401, 201402, there is no breakdown on segment, there is always only 1 row (segment = overall  ), So the summery row  (bold) for 201401, 201402 is really redundant, my question is , how can i conditionally run Break statement so that for any months related to 2014, there will Not be any summary row.

 

(2) For the summary row, i actually want to display the  value of mailing month as well (but keep it empty for listtype)  how can i do that ?

 Thanks
TC

SAS Super FREQ
Posts: 8,641

Re: Proc report - break condtionally ?

Hi:
Regarding your questions #1 -- PROC REPORT will always produce a break line -- no matter how many detail rows there are so for 201401 and 201402, you will NOT be able to suppress the automatic BREAK line from your BREAK statement. I am not sure I understand what you mean by #2 -- where you want to display the value of mailing month -- you suppressed the display with the SUPPRESS option on the BREAK statement. If you take off the SUPPRESS, do you get what you want???
cynthia
New Contributor
Posts: 2

Re: Proc report - break condtionally ?

1. Well then what if i dont use break statement, and use other statements, will i be able to display conditionally?

2. I just want to show bit more info on the summary row (see blue)

List TypeMailing MonthSegmentsImpression
   14009
1- All Lists201401Overall14009
  201501Total12992
 201501Ballots all426
  Regular8339
  Test12108
  Test22119
   14339
 201402Overall14339
  201502Total14145
 201502Ballots all389
  Regular9109
  Test12322
  Test22325

 

SAS Super FREQ
Posts: 8,641

Re: Proc report - break condtionally ?

Hi:
You did not post ALL your code or any sample of your data. So in order to make any constructive suggestions, someone has to guess at the structure of the data, make some fake data and then guess at the type of output you want to create (RTF, PDF, HTML, Excel, CSV, etc) and THEN guess at the rest of your PROC REPORT statements. So you did not make it easy for anyone to help you.

Did you take off the SUPPRESS to see what the result would be???

You can use a COMPUTE block to customize the BREAK line (such as add the word Total).

Without data to test with or ALL your code (PROC REPORT statement, COLUMN statement) including the destination statements, it is very hard to answer #1.

For a suggestion about #2, you would need a COMPUTE block if taking off SUPPRESS didn't do what you wanted to show the month.

cynthia
Post a Question
Discussion Stats
  • 3 replies
  • 321 views
  • 0 likes
  • 2 in conversation