LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 15 Jan 2008 13:59:45 -0500
Reply-To:     Paul Miller <pmiller@OHTN.ON.CA>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Paul Miller <pmiller@OHTN.ON.CA>
Subject:      Justification Problem in Proc Report
In-Reply-To:  <200709031905.l83Al6VD007379@mailgw.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"

Hello Everyone,

I'm having a little trouble justifying the labels for two columns using the Proc Report syntax below.

PROC FORMAT; PICTURE NFMT .='0' (NOEDIT) OTHER='009'; PICTURE PCTFMT .='0%' (NOEDIT) OTHER='009.9%' (MULT=1000); RUN;

OPTIONS MISSING='.'; ODS ESCAPECHAR='^'; ODS LISTING CLOSE; ODS HTML BODY='BODY.HTML' STYLE=MINIMAL;

PROC REPORT DATA=QUERY_DATA NOWD HEADLINE HEADSKIP STYLE(HEADER)=[FONT_SIZE=2.0 HTMLSTYLE="WHITE-SPACE:NOWRAP" just=c] STYLE(COLUMN)=[FONT_SIZE=2.0 HTMLSTYLE="WHITE-SPACE:NOWRAP"];

TITLE ;

COLUMN ('EXPOSURE' EXPOSURE_CATEGORY) ('GEOGRAPHICAL REGION' REGION,(N PCTN X)) N PCTN ('^S={font_weight=medium} TOTAL' Y); DEFINE EXPOSURE_CATEGORY / GROUP ' ' style(header)=[just=L]; DEFINE REGION / ACROSS '' STYLE(header)=[JUST=c font_weight=medium]; DEFINE N / NOPRINT; DEFINE PCTN / FORMAT=PERCENT8.1 NOPRINT; DEFINE X / COMPUTED FORMAT=$20. ' ' style(column)=[just=r]; DEFINE Y / COMPUTED FORMAT=$20. ' ' style(column)=[just=r];

COMPUTE X / CHAR; _C4_=TRIM(LEFT(PUT(_C2_,nfmt.)))||' ('||TRIM(LEFT(PUT(_C3_,pctfmt.)))||')'; _C7_=TRIM(LEFT(PUT(_C5_,nfmt.)))||' ('||TRIM(LEFT(PUT(_C6_,pctfmt.)))||')'; _C10_=TRIM(LEFT(PUT(_C8_,nfmt.)))||' ('||TRIM(LEFT(PUT(_C9_,pctfmt.)))||')'; _C13_=TRIM(LEFT(PUT(_C11_,nfmt.)))||' ('||TRIM(LEFT(PUT(_C12_,pctfmt.)))||')'; _C16_=TRIM(LEFT(PUT(_C14_,nfmt.)))||' ('||TRIM(LEFT(PUT(_C15_,pctfmt.)))||')'; _C19_=TRIM(LEFT(PUT(_C17_,nfmt.)))||' ('||TRIM(LEFT(PUT(_C18_,pctfmt.)))||')'; _C22_=TRIM(LEFT(PUT(_C20_,nfmt.)))||' ('||TRIM(LEFT(PUT(_C21_,pctfmt.)))||')'; _C25_=TRIM(LEFT(PUT(_C23_,nfmt.)))||' ('||TRIM(LEFT(PUT(_C24_,pctfmt.)))||')'; _C28_=TRIM(LEFT(PUT(_C26_,nfmt.)))||' ('||TRIM(LEFT(PUT(_C27_,pctfmt.)))||')'; ENDCOMP;

COMPUTE Y / CHAR; Y=TRIM(LEFT(PUT(N,nfmt.)))||' ('||TRIM(LEFT(PUT(PCTN,pctfmt.)))||')'; ENDCOMP;

RBREAK AFTER / SUMMARIZE;

COMPUTE AFTER; EXPOSURE_CATEGORY='TOTAL'; ENDCOMP;

RUN;

ODS HTML CLOSE; ODS LISTING;

In my output table, I have a column on the far left labelled 'EXPOSURE' and on the far right I have a column labelled 'TOTAL'. As it stands, justification of the labels for these two columns is inextricably linked. That is, I can center both labels or left justify both labels but I can't left justify the label for the exposure column and center the label for the total column.

I'm told that this is a shortcoming in the current version of SAS and that it will be changed in a future release. In the meantime, I was wondering if someone might be able to see some kind of workaround. I'm thinking not. But I thought I'd ask just in case.

Thanks,

Paul

Paul J. Miller, Ph.D. Research Scientist and Statistician Ontario HIV Treatment Network 1300 Yonge St., Suite 308 Toronto, Ontario M4T 1X3 Phone: (416) 642-6486 ext 232 Fax: (416) 640-4245


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