BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello,
i make this code but i don't find how to extend the width of my colums or of my table more generally ?
it's because i find that right now, this following output is really not nice to see...
of course, i want it for RTF output...
the code is:

proc template;
define table tabsas ;
dynamic header_text footer_text ;
header head1 ;
column age sex height;
define head1; text header_text ; just=L;end;
define age; Header="age" just=c; just=c; end;
define sex ; Header="sex" just=c; just=c; end;
define height; Header="height" just=c; end;
end;
run;

ods rtf file="mypath\mydoc.rtf";

data _null_;
set sashelp.class;
file print ods=( dynamic=( header_text="is there a way to increase the width of my table output to make it nicer" )
template='tabsas');
put _ods_;
run;

ods rtf close;

Thank you for your answers, i trust you :-))
5 REPLIES 5
ChrisNZ
Tourmaline | Level 20
How about:

[pre]proc template ;
define table tabsas / STORE=SASUSER.TEMPLAT;
dynamic header_text footer_text ;
header head1 ;
column age sex height;
define head1; text header_text ; just=l; split='/'; end;
define age; Header="age" just=c; just=c; end;
define sex ; Header="sex" just=c; just=c; end;
define height; Header="height" just=c; end;
end;
run;

ods rtf file="f:\mydoc.rtf";

data _null_;
set sashelp.class;
file print ods=( dynamic=(header_text="There is a way to increase/the width of my table") template='tabsas');
put _ods_;
run;

ods rtf close;
Cynthia_sas
SAS Super FREQ
Hi:
You could apply a style to the -whole- table by doing this:
[pre]
column age sex height;
style={outputwidth=6in};
[/pre]

A style specification that is NOT inside any column DEFINE block, but is inside the DEFINE TABLE block, will apply to the whole table.

cynthia
deleted_user
Not applicable
Thank you for your answer
and i have another question:
Why the just=c in numeric variables like age and height have not effect in my output ?
How can i do to center these numeric variables ?
Thank you
Cynthia_sas
SAS Super FREQ
Hi:
It could be that SAS is respecting the formatted width -- so the -formatted- number, padded with spaces, is what gets centered. It ends up looking like no centering has taken place.
The statement to deal with this is the JUSTIFY statement. You would set it in your define block to JUSTIFY=OFF; (the default) if you want the formatted width to be respected and set it to JUSTIFY=ON; if you want the justification to ignore the formatted width, not pad with spaces and allow your just=c to take control.
If it turns out that it's NOT the JUSTIFY setting, then you might want to work with Tech Support. Remember JUSTIFY=ON essentially tells ODS to allow justification to happen without regard to the formatted width -- that sounds like what you want.

cynthia
deleted_user
Not applicable
thank you very much for your help

sas-innovate-2024.png

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.

 

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
  • 5 replies
  • 739 views
  • 0 likes
  • 3 in conversation