BookmarkSubscribeRSS Feed
msecic
Calcite | Level 5

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                             ValueGroup AGroup BTotal
(n=7)(n=6)(n=13)
RandomizedYes7 (100.0 %)6 (100.0 %)13 (100.0 %)
Prematurely DiscontinuedNo4 (57.1 %)3 (50.0 %)7 (53.8 %)
Yes3 (42.9 %)3 (50.0 %)6 (46.2 %)
Enrolled in Next OneNo1 (14.3 %)1 (16.7 %)2 (15.4 %)
No2 (28.6 %)1 (16.7 %)3 (23.1 %)
Missing Values4 (57.1 %)4 (66.7 %)8 (61.5 %)
Reason Discontinued:Adverse Event0 (0.0%)1 (33.3 %)1 (16.7 %)
Ulcer2 (66.7 %)0 (0.0%)2 (33.3 %)
Lost to follow-up1 (33.3 %)0 (0.0%)1 (16.7 %)
Other0 (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;

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

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;


use_correct_method.png
msecic
Calcite | Level 5

Oh my gosh, Cynthia!  Thank you so very much!  It worked perfectly!!!!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 5370 views
  • 3 likes
  • 2 in conversation