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 (January 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 7 Jan 2004 18:31:42 -0800
Reply-To:     Don STanley <don.stanley@NBNZ.CO.NZ>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Don STanley <don.stanley@NBNZ.CO.NZ>
Organization: http://groups.google.com
Subject:      Re: Tip: Mixing Formats In A Single Column In PROC REPORT
Content-Type: text/plain; charset=ISO-8859-1

I also have another way to do this which may be preferable under some circumstance. That is to make the format a variable in the input dataset, which removes the need for the conditional logic in PROC REPORT. Using this, the code becomes ...

data ; x= 'abc' ; y= 264365 ; z = 4563773 ; format='comma10.' ; output ; x = 'xyz' ; y = 89.65 ; z = 87.98 ; format = '8.2' ; output ; run ;

proc report data=_last_ nowd ; column x ('Savings' (_numeric_)) format;

compute x ; xcol = _col_ ; endcomp; define format / noprint ; compute format ; do i=xcol+1 to _col_-1 ; call define(i,'format',format) ; end ; endcomp ; run ;

which may be a bit simpler. We're sticking with the format in the proc report here, as it means the format is always available without developer intervention.

cheers Don


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