BookmarkSubscribeRSS Feed
Bill
Quartz | Level 8
Hello;

I've a space constrained output that's being produced via ODS and proc tabulate. I'm finding that I could reduce the space between the various rows of data in the output table. I've looked at the ODS template (theme) and been overwhelmed by the options. Which option do I need to alter to reduce the between row spacing?

Thanks,
Bill
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
Try the cellpadding= style override on the TABLE statement -- you may not have to move to a style template yet!
[pre]
table ......./ style={cellpadding=2px};
[/pre]

You might also search the forum for a previous posting on creating very wide output -- there were quite a few suggestions in that posting, including cellpadding, and font_size changes.

The cellpadding style attribute controls the amount of "white" space around the letters and numbers in each data cell. If you reduce the cellpadding, you may eventually make the cellpadding too small, which won't be very readable.

If you are using ODS RTF or ODS PDF, you might consider changing the orientation to landscape:
options orientation=landscape; (before the ODS RTF or ODS PDF statements)

cynthia
Bill
Quartz | Level 8
Thanks Cynthia;

I tried the cellpadding in the table statement as you suggested but it didn't seem to produce the desired effect.

Since then, I've moved to a different ods template and changed the cellpadding successfully.

proc template;
define style mytheme;
parent=styles.meadow;
replace Body from Document
"Undef margins so we get the margins from the printer or SYS option"
/
bottommargin = 0.19in
topmargin = 0.19in
rightmargin = 0.20in
leftmargin = 0.20in;
replace Table from output/
cellpadding=1.2pt;
end;
run;

The problem is that cellpadding reduces the white space on all four sides of the value. I only want to reduce the space between rows, not between columns. I increased the format to comma20.0 on the table statement, but the template seems to override that.

table Slab_Source_Dim_Cd=''*
(SLAB_GRD_FAM_NAME='' all) all*[style=[font_size=6.5pt font_weight=bold]],
InvenDate=''*
(PROD_GRP_DIM_CD='' all) *invendate2=''*sum=' '
SLAB_LOC_DIM_CD="&sysdate, By Location" *
SLABTONs=' ' *sum=' '*format=comma20.0

How then do I reduce between row space independently of between column space?
Cynthia_sas
SAS Super FREQ
Hi:
As you noted, ODS cellpadding style attribute is ALL the white space. The formatted width for a variable does not have an impact on ODS output -- only on LISTING window output. So your idea of using f=comma20. would NOT work in ODS HTML, RTF or PDF -- those destinations allot only the needed space for the number -- it does not pad the format width, as in Listing.

If your destination of choice is HTML, then you might be able to use CSS style properties by setting:
[pre]
HTMLSTYLE='padding-top: 0px; padding-left: 3px; padding-right: 3px; padding-bottom: 0px;'
[/pre]

However, CSS style properties cannot be used for RTF and PDF in SAS 8 or 9.1.3. You may be able to use the new CSSSTYLE option in order to use a CSS style sheet with RTF and PDF in 9.2.

For more information on using the HTMLSTYLE attribute in a style template or a STYLE= override, refer to these sites:
http://support.sas.com/rnd/base/ods/templateFAQ/report1.html (shows a lot of HTMLSTYLE examples)
http://support.sas.com/kb/23/373.html (shows NOWRAP)
http://support.sas.com/rnd/base/ods/templateFAQ/Template_csstyle.html#htmlstyle (shows COLOR)

cynthia

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