LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (October 2003, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 9 Oct 2003 16:30:56 +0200
Reply-To:     Andre Wielki <wielki@INED.FR>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Andre Wielki <wielki@INED.FR>
Subject:      Re: tabulate style
Comments: To: Quentin_McMullen@BROWN.EDU
In-Reply-To:  <200310091243.h99ChpHD029185@perseus.services.brown.edu>
Content-Type: text/plain; charset="us-ascii"; format=flowed

Quentin, You will say "of course"

HTH Andre

proc format; value race 1='White' 2='Black' 3='Asian' 4='Other' ; value ethnic 0='Hispanic' 1='Non-Hispanic' ; value empt low-high=" "; run;

data foo; input id race ethnic ; format race race. ethnic ethnic. ; cards; 1 1 1 2 1 0 3 1 0 4 2 1 5 2 1 ; run;

ods rtf file="c:\temp\myout2.rtf"; proc tabulate data=foo order=fmt missing ; class race ethnic; classlev race ethnic / style=[just=left pretext='^R/RTF"\li240" ']; table race all=' '*[Style=[background=white foreground=white]]*F=empt. ethnic ,n='N'*[Style=[cellwidth= 3 cm]] colpctn='%' /printmiss misstext='0' ; run; ods rtf close; ;

At 08:43 09/10/2003 -0400, Quentin McMullen wrote: >Hi All, > >Well, I'm forced to admit that I'm one of those SAS programmers who has >gotten by with lots of proc freqs and means and a small handful of data >_null_'s, managing to avoid proc tabulate and proc report for far too long... > >I've bitten the bullet and am trying to do some tabulate with ODS and have >a question re styles. > >If I run the following code I get a reasonable table: > >___________ > >proc format; > value race > 1='White' > 2='Black' > 3='Asian' > 4='Other' > ; > value ethnic > 0='Hispanic' > 1='Non-Hispanic' > ; >run; > >data foo; > input id race ethnic ; > format race race. ethnic ethnic. ; > cards; >1 1 1 >2 1 0 >3 1 0 >4 2 1 >5 2 1 >; >run; > >ods escapechar='^'; >ods rtf file="c:\junk\myout1.rtf"; >proc tabulate data=foo order=fmt missing ; > class race ethnic; > classlev race ethnic / style=[just=left > pretext='^R/RTF"\li240" ']; > table race ethnic > ,n='N'*[Style=[cellwidth= 3 cm]] > colpctn='%' > /printmiss misstext='0' > ; >run; >ods rtf close;; >____________ > >But then I thought it would be nice to have a blank row in between the two >variables, i.e.: > >race n % > black # # > white # # > >ethnic > hisp # # > non-hisp. # # > >So I cracked open ODS: The Basics, and was inspired to try a work-around: >add an all variable with a style to make it white foreground on white >background: >____________ > >ods rtf file="c:\junk\myout2.rtf"; >proc tabulate data=foo order=fmt missing ; > class race ethnic; > classlev race ethnic / style=[just=left > pretext='^R/RTF"\li240" ']; > table race > all=' '*[Style=[background=white foreground=white]] > ethnic > ,n='N'*[Style=[cellwidth= 3 cm]] > colpctn='%' > /printmiss misstext='0' > ; >run; >ods rtf close; >____________ > >But when I run that, I get a row with a blank label (good), a blank in the >% cell (good), but a number in the N cell (doh!).: > >race n % > black # # > white # # > # >ethnic > hisp # # > non-hisp. # # > >Seems that my problem is I am applying a style to a row variable and a >column variable, and in this case seems like the column variable style wins >out. If I comment out the style statement for N, then everything works >fine (i.e. the N cell will be blank, taking it's properties from the style >attributes of the ALL row). But of course I want to specify the cell width >(and other attributes) of the N column. > >My questions are: >1) Am I right that I should avoid assigning styles to both rows and >columns? (Or if it is okay to do so, what rules determine precedence, etc?). >2) What is a good way to add a blank row in between the variables. > >Thanks for any help, suggestions for further reading, etc etc. > >Kind Regards, >--Quentin

___________ WIELKI Andre INED - Service Informatique 133 Bd Davout, 75 980 Paris Cedex 20 FRANCE Tel: 01 56 06 21 54


Back to: Top of message | Previous page | Main SAS-L page