Date: Wed, 10 Mar 2004 18:35:41 -0500
Reply-To: "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM>
Subject: Re: Substring Puzzle
On Wed, 10 Mar 2004 18:01:29 -0500, Richard A. DeVenezia
<radevenz@IX.NETCOM.COM> wrote:
>>A compiler change yes. But is it a bug fix or a clarified feature. Why
is
>z still 12 length?
Hi,
I have a hypothesis. if c is not initialized but used in an expression,
then sas assumes a numeric variable and convert it to a string using
best12 format. This is kind of consistent with the following results, too.
This is not a definitive test of this hypothesis, but...
Cheers,
Chang
data _null_;
z = substr(c,1,1);
zz = trimn(d);
length_z = vlength(z);
length_zz = vlength(zz);
put (_all_) (= +(-1) "***" /);
run;
/* on log
z=
c=.
zz=.
d=.
length_z=12
length_zz=12
*/
|