Hi Good evening all,
Need suggession in proc report. i used the below code for sashelp.class
ods tagsets.excelxp file="D:\New folder\sample.xls" style=minimal;
proc report data=sashelp.class nowd
STYLE(HEADER)={BACKGROUND=STEELBLUE FOREGROUND=WHITE FONTWEIGHT=BOLD FONT_FACE='CALIBRI' FONT_SIZE=10PT JUST=CENTER}
STYLE(REPORT)={BACKGROUND=WHITE FOREGROUND=BLACK BORDERCOLOR=WHITE FONT_FACE='CALIBRI' FONT_SIZE=10PT};
column sex ('Details' weight height);
define sex/ group;
define age/group;
define height /display;
define weight/display;
run;
ods tagsets.excelxp close;
the row header sex should be in center
by group variable of sex (F,M) that are also in center
the actual output we are getting and desired output i had attached in excel file.
please help me in this regard.
Thanks in advance.
After define sex/group style={just=center};
or
style(column)={just=center} in proc report option.
tried but not giving desired output
Hi:
It's not clear to me what you want. Just running your code, I can see that the header for SEX -is- centered -- you have to make the column wider to see the centering. But you only put JUST=CENTER on the STYLE(HEADER) override.
If you want to see the F and M also centered, then you need to do an override on the DEFINE for the SEX variable, as Reeza showed.
define sex / group style(column)={just=c};
If you want to "span" the row area then use the SPANROWS option.
cynthia
ods rtf file="D:\New folder\sample123.rtf" style=overrides;
proc report data=sashelp.class nowd
STYLE(HEADER)={BACKGROUND=STEELBLUE FOREGROUND=WHITE FONTWEIGHT=BOLD FONT_FACE='CALIBRI' FONT_SIZE=10PT JUST=CENTER}
STYLE(REPORT)={BACKGROUND=WHITE FOREGROUND=BLACK BORDERCOLOR=WHITE FONT_FACE='CALIBRI' FONT_SIZE=10PT} SPANROWS;
column sex ('Details' weight height);
define sex / group style(column)= {just=center textalign=middle} ;
define age/group;
define height /display;
define weight/display;
run;
ods rtf close;
tried with ods rtf but desired output is not coming.
please suggest me.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.