BookmarkSubscribeRSS Feed
love0715
Calcite | Level 5

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

3 REPLIES 3
Cynthia_sas
SAS Super FREQ
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
love0715
Calcite | Level 5

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

 

Cynthia_sas
SAS Super FREQ
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

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 992 views
  • 0 likes
  • 2 in conversation