| 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 |
|
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/
|