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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.