Help using Base SAS procedures

Proc Report, 2 Group variables

Reply
N/A
Posts: 0

Proc Report, 2 Group variables

Is there a way to avoid repetition of the first group id in the first row after the summary line when this one was produced by break before ... / summarize? See the following code:
proc report data=sashelp.class headskip nowd;
column sex name (age height weight),mean;
define sex / group width=3;
define name / group;
break before sex / summarize;
break after sex / skip;
compute before sex; name='Total'; endcomp;
run;
Regular Contributor
Posts: 171

Re: Proc Report, 2 Group variables

You could add a second compute block:

proc report data=sashelp.class headskip nowd;
column sex name (age height weight),mean;
define sex / group width=3;
define name / group;
break before sex / summarize;
break after sex / skip;
compute before sex; name='Total'; endcomp;
compute sex;
IF UPCASE(_BREAK_) NE 'SEX' THEN SEX= ' ';
ENDCOMP;
run;
SAS Super FREQ
Posts: 8,743

Re: Proc Report, 2 Group variables

Hi:
Also, if you are going to use ODS eventually to send this output to RTF, PDF or HTML output files, remember that options such as HEADLINE, HEADSKIP, SKIP, and WIDTH= are only used by the LISTING window and will not work for other ODS destinations. So, for example, if you wanted to perform the EQUIVALENT of a SKIP for other ODS destinations, you would need to add:
[pre]
compute after sex;
line ' ';
endcomp;
[/pre]

because the SKIP in your code would be ignored.

cynthia
Ask a Question
Discussion stats
  • 2 replies
  • 109 views
  • 0 likes
  • 3 in conversation