The SAS Output Delivery System and reporting techniques

about proc template

Reply
N/A
Posts: 0

about proc template

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 :-))
PROC Star
Posts: 1,759

Re: about proc template

Posted in reply to deleted_user
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;
SAS Super FREQ
Posts: 8,862

Re: about proc template

Posted in reply to deleted_user
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
N/A
Posts: 0

Re: about proc template

Posted in reply to deleted_user
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
SAS Super FREQ
Posts: 8,862

Re: about proc template

Posted in reply to deleted_user
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
N/A
Posts: 0

Re: about proc template

Posted in reply to deleted_user
thank you very much for your help
Ask a Question
Discussion stats
  • 5 replies
  • 169 views
  • 0 likes
  • 3 in conversation