Date: Sun, 26 Oct 2003 20:35:32 -0800
Reply-To: "Huang, Ya" <yhuang@AMYLIN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Huang, Ya" <yhuang@AMYLIN.COM>
Subject: Re: option flow in proc report -- sas
Content-Type: text/plain; charset="iso-8859-1"
Helen,
You may try ods/rtf:
data final;
length name $40; /** note the length statement here **/
set test1(in=a)
test2(in=b);
if a then do;
name= 'Happy Halloween!';
num=1;
end;
else if b then do;
if num1=1 then do;
name=var1;
end;
else if num1=2 then do;
name="^R/RTF'\li180 '"||var2;
end;
end;
run;
ods rtf file="c:\temp\junk.rtf" style=minimal;
ods escapechar='^';
proc report data=final nowd;
column num name;
define num / order noprint;
define name /display "****NAME***" style=[cellwidth=1.5in];
compute before num;
line ' ';
endcomp;
break after num /skip;
run;
ods rtf close;
Kind regards,
Ya Huang
-----Original Message-----
From: helen [mailto:chenghelen2000@YAHOO.COM]
Sent: Sunday, October 26, 2003 5:57 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: option flow in proc report -- sas
Hello,
I was wondering if anyone had any sample to handle the situation
('flow' in proc report) described below. I would like the variable
'name' in the final dataset below to wrap around when the var. length
reaches 40. The issue here is when
name =' '||var2,
I would like the value to wrap around and line up as shown below.
Because the length of each word within var2 (ex fea, fdghd) is not
fixed, perhaps the issue can not be resolved by simple code. Is there
a resolution or work-around for this.
Thank you
Helen
The final report:
******NAME******
Happy Halloween!
csas c v aaa aa
fea fdghd fhfhfdh/*rest char, go next line&lineup to fea;
ff hfhfhfhfhfh
sdfs xx
xv cfvxx nvncnhn
ggf gh mm
dgsbs fh hf jj jkkl
.............
.............
The data test2:
Var1 var2 num1 num
csas c v aaa aa 1 2
fea fdghd fhfhfdh ff hfhfhfhfhfh 2 3
sdfs xx 2 3
xv cfvxx nvncnhn ggf gh mm 2 3
dgsbs fh hf jj jkkl 1 4
.....
data test1:
var num
'****' 1
data final;
set test1(in=a)
test2(in=b);
if a then do;
name= 'Happy Halloween!';
num=1;
end;
else if b then do;
if num1=1 then do;
name=var1;
end;
else if num1=2 then do;
name=' '||var2;
end;
end;
run;
proc report data=final nowd;
column num name;
define num / order noprint;
define name /display "****NAME***" width=40 flow left;
compute before num;
line ' ';
endcomp;
break after num /skip;
run;