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 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 28 Jan 2008 13:51:32 -0500
Reply-To:     "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Organization: Internet News Service
Subject:      Re: proc report putn() analog
Comments: To: sas-l@uga.edu

johnI wrote: > putn( var, format) allows the use of a variable containing the format > to format the display of var. is there a similar feature in proc > report where a variable on the data set can serve as the repository > for formats for the display variables?

Yes. Use a COMPUTE block.

data foo; do x = 0 to 50; length format $32; if mod (x,3) = 0 then format = 'z5.'; else if mod (x,3) = 1 then format = '5.3;'; else format='e12.';

output; end; run;

ods pdf file="%sysfunc(pathname(WORK))\demo.pdf" style=meadow;

proc report data=foo nowindows; columns x format xrender; define x / display noprint; define format / display noprint; define xrender / computed; compute xrender / character length=50; xrender = putn (x, format); endcomp; run;

ods pdf close;

-- Richard A. DeVenezia http://www.devenezia.com/


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