- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 12-02-2020 10:33 AM
(1219 views)
proc print data=sashelp.class
noobs round GTOTAL_LABEL="TOTAL" style(header)={backgroundcolor=cyan color=black fontsize=2 fontweight=bold just=center}
style(header data)={bordertopwidth=.5 borderbottomwidth=.5
borderleftwidth=.5 borderrightwidth=.5 borderstyle=solid bordercolor=black};
sum height age /STYLE(GRANDTOTAL)={backgroundcolor=cyan color=black fontsize=2};
var name;
var age height ;
run;
I am not getting Total to be wriiten in Output. Can anybody help me with proc print GTOTAL_LABEL options available in proc print .
5 REPLIES 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Works with a BY statement. Otherwise, without a BY statement in PROC PRINT, no GRANDTOTAL is printed, only a SUM is printed (and you can use SUMLABEL=' ').
--
Paige Miller
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
With sumlabel as well I am not getting Total . Is SUMLABEL also works with BY only ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
From the docs:
SUMLABEL='label'
specifies the text to use as a label on the summary line of a BY group. You can include the #BYVAR and #BYVAL variables in 'label'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes, SUMLABEL only works with a BY statement. You can add a fake BY statement and use just the GRANDTOTAL option instead of subtotals if that will work. Again, wrong tool for what you're trying to do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Use the right tool for the right job, AKA it would be easier with REPORT or TABULATE.