want to left justify the column headers for the variables 'characteristic' and 'stat_cat_'. As you can see from my output below, this is NOT happening - see my code after the output. Please help!
Here's my output:
Disposition | Value | Group A | Group B | Total |
(n=7) | (n=6) | (n=13) | ||
Randomized | Yes | 7 (100.0 %) | 6 (100.0 %) | 13 (100.0 %) |
Prematurely Discontinued | No | 4 (57.1 %) | 3 (50.0 %) | 7 (53.8 %) |
Yes | 3 (42.9 %) | 3 (50.0 %) | 6 (46.2 %) | |
Enrolled in Next One | No | 1 (14.3 %) | 1 (16.7 %) | 2 (15.4 %) |
No | 2 (28.6 %) | 1 (16.7 %) | 3 (23.1 %) | |
Missing Values | 4 (57.1 %) | 4 (66.7 %) | 8 (61.5 %) | |
Reason Discontinued: | Adverse Event | 0 (0.0%) | 1 (33.3 %) | 1 (16.7 %) |
Ulcer | 2 (66.7 %) | 0 (0.0%) | 2 (33.3 %) | |
Lost to follow-up | 1 (33.3 %) | 0 (0.0%) | 1 (16.7 %) | |
Other | 0 (0.0%) | 1 (33.3 %) | 1 (16.7 %) | |
0 (0.0%) | 1 (33.3 %) | 1 (16.7 %) |
Here's my code:
/** RTF **/
%RTFOPTNS;
%OUTFILE(NAME=T1_1_SubjectDisposition); ** Name the Output file ** ;
OPTION MISSING=' ';
ODS LISTING CLOSE;
ODS RTF FILE=RTFFILE STYLE=STYLES.RTFSTYLE BODYTITLE;
ODS NORESULTS;
PROC REPORT DATA=final NOWD HEADLINE HEADSKIP SPLIT='|' SPACING=2 MISSING ;
COLUMN characteristic stat_cat_ var1 var2 var99;
DEFINE characteristic/DISPLAY WIDTH=15 left "Disposition"
STYLE(COLUMN)=[CELLWIDTH=1.25IN ];
DEFINE stat_cat_/DISPLAY WIDTH=15 left "Value"
STYLE(COLUMN)=[CELLWIDTH=3.75IN ];
DEFINE var1/DISPLAY WIDTH=15 CENTER "PluroGel N|(n=&grpPRand.)"
STYLE(COLUMN)=[CELLWIDTH=1.0IN ];
DEFINE var2/DISPLAY WIDTH=15 CENTER "Vehicle|(n=&grpPRand.)"
STYLE(COLUMN)=[CELLWIDTH=1.0IN ];
DEFINE var99/DISPLAY WIDTH=15 CENTER "Total|(n=&grpTotRand)"
STYLE(COLUMN)=[CELLWIDTH=1.0IN ];
%RTFTITLES(t3=Table 14.1.1 Subject Disposition);
RUN;
OPTIONS MISSING='.';
FOOTNOTE; TITLE;
ODS RTF CLOSE;
ODS pdf CLOSE;
ODS LISTING ;
PROC PRINTTO;
RUN;
Hi:
ODS RTF generally does NOT use LISTING options like LEFT. If you use an ODS STYLE= override, you should see left justification. See the attached code and the screen shot. I used width=100% so the columns were wider than usual so the justification change was immediately apparent.
Cynthia
ods rtf file='c:\temp\lj.rtf' ;
proc report data=sashelp.class nowd
style(report)={width=100%};
title '1) using LISTING option';
column name age sex height weight;
define name / 'Disposition' left;
define age / 'Value' left;
run;
proc report data=sashelp.class nowd
style(report)={width=100%};
title '2) using ODS STYLE= option';
column name age sex height weight;
define name / 'Disposition' style(header)={just=l};
define age / 'Value' style(header)={just=l};
run;
ods rtf close;
Oh my gosh, Cynthia! Thank you so very much! It worked perfectly!!!!
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.