Date: Wed, 30 Apr 2008 16:21:45 -0400
Reply-To: Ya Huang <ya.huang@AMYLIN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ya Huang <ya.huang@AMYLIN.COM>
Subject: Re: Printing Carriage Returns
Something like this?
data xx;
file print;
do i=1 to 3;
line1= 'abc';
line2= 'def';
line3= 'ghi';
output;
end;
run;
data _null_;
file print;
set xx;
if _n_=1 then put @1 'line1' @10 'line2' @20 'line3' @30 'text';
put @1 line1 @10 line2 @20 line3 @30 line1;
put @30 line2 / @30 line3;
run;
line1 line2 line3 tex
abc def ghi abc
def
ghi
abc def ghi abc
def
ghi
abc def ghi abc
def
ghi
On Wed, 30 Apr 2008 13:06:34 -0700, Wing9897@HOTMAIL.COM wrote:
>On Apr 30, 2:14 pm, ya.hu...@AMYLIN.COM (Ya Huang) wrote:
>> How about data _null_ reporting?
>>
>> data _null_;
>> file print;
>> line1= 'line1';
>> line2= 'line2';
>> line3= 'line3';
>> put line1 /// line2 /// line3;
>> run;
>>
>> line1
>>
>> line2
>>
>> line3
>>
>>
>>
>> On Wed, 30 Apr 2008 10:54:09 -0700, Wing9...@HOTMAIL.COM wrote:
>> >Hello,
>>
>> >I would like to print a variable that contains 2 carriage returns and
>> >have it actually execute the carriage returns so that there are 3
>> >lines for that 1 observation. How can this be accomplished? Thanks.
>>
>> >data test;
>>
>> >line1= 'line1';
>> >line2= 'line2';
>> >line3= 'line3';
>>
>> >text= cat(line1,'0D0A'x,line2,'0D0A'x,line3,'0D0A'x);
>>
>> >run;
>>
>> >proc print data=test;
>> >run;- Hide quoted text -
>>
>> - Show quoted text -
>
>Actually, I would like to have the carriage returns enacted in a
>report or print out so that a person can take the report and easily
>compare it to the GUI from which the data originated. I would like it
>to look like this.
>
>
>i line1 line2 line3 text
>
>1 line1 line2 line3 line1
> line2
> line3
>
>2 line1 line2 line3 line1
> line2
> line3
>
>3 line1 line2 line3 line1
> line2
> line3
>
>
>data test;
>
> do i=1 to 3;
> line1= 'line1';
> line2= 'line2';
> line3= 'line3';
> text= cat(line1,'0D0A'x,line2,'0D0A'x,line3,'0D0A'x);
> output;
> end;
>
>run;
>
>proc print data=test;
>run;
>
>
>Thanks.
|