|
Yu,
There are some strange things here. The TRIM is not needed!!
This can be proved by adding a PUT statement in the DATA step.
I was able to run (interactively) the original code after assigning PID and
there was no problem except that a window popped up saying that the width
had not been specified. However, it chose a short width and produced the
report.
When I ran in batch the missing width cause PROC REPORT to not execute.
With a width specified, the batch run produced the complete report.
None of this is meant to imply that the TRIM is not a wise idea.
Ian Whitlock
=================
Date: Tue, 27 Jun 2006 12:57:07 -0500
Reply-To: Yu Zhang <zhangyu05@GMAIL.COM>
Sender: "SAS(r) Discussion"
From: Yu Zhang <zhangyu05@GMAIL.COM>
Subject: Re: Maximum length of a string
Comments: To: "Sridhar, Kumar" <nsridhar@medarex.com>
In-Reply-To: <697B27DC3052C74FB9A3A3FACED43ED8341555@njb-ms1>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Kumar,
I just made a slightly change on the code you provided. the entire value is
showed up.
Let me know,if I misunderstood your question.
data test;
length x y $200. z $400.;
x='RETROPERITONEAL AND LEFT GREATER THAN RIGHT, PELVIC
LYMPHADENOPATHY. MAJORITY OF NODES
ARE STABLE IN SIZE COMPARED TO PRIOR EXAMS, SLIGHT INCREASE IN
SOME RETROPERITONEAL LYMPH NODES, PARTICULARLY IN';
y='THE PERIAORTIC AND LEFT PERIAORTIC REGION.';
z=trim(x)||' '|| trim(y);
run;
options linesize=128;
proc report data=test nowds ;
columns z;
define z /'test' width=96 display flow;
run;
On 6/27/06, Sridhar, Kumar <nsridhar@medarex.com> wrote:
>
> Hi all:
>
> I have to character variables (each of length $200) that I
> concatenate. I would like the resulting variable to be of length $400
> and show me the entire value
>
> Of the variable. Unfortunately, right now it shows me the variable1.
> Any ideas how to do this would be greatly appreciated.
>
>
>
> data test;
>
> length x y $200. z $400.;
>
> x='RETROPERITONEAL AND LEFT GREATER THAN RIGHT, PELVIC
> LYMPHADENOPATHY. MAJORITY OF NODES
>
> ARE STABLE IN SIZE COMPARED TO PRIOR EXAMS, SLIGHT INCREASE IN
> SOME RETROPERITONEAL LYMPH NODES, PARTICULARLY IN';
>
> y='THE PERIAORTIC AND LEFT PERIAORTIC REGION.';
>
> z=x||' '|| y;
>
> run;
>
>
>
> proc report data=test;
>
> columns pid z;
>
> define z /'test' display flow;
>
> run;
>
>
>
> Thanks and regards
>
>
>
> Kumar Sridhar
>
>
>
|