Date: Thu, 27 Mar 2008 11:38:19 -0400
Reply-To: "Diskin, Dennis" <Dennis.Diskin@PHARMA.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Diskin, Dennis" <Dennis.Diskin@PHARMA.COM>
Subject: Re: Array question
In-Reply-To: A<BLU132-W3D4D26B45D3D885C6156FC8FE0@phx.gbl>
Content-Type: text/plain; charset="us-ascii"
What are you trying to accomplish with
if thchange(1) then do;
The IF expression THEN
statement assumes the expression results in a numeric result. You
probable want:
if thchange(1) ne ' ' then do;
but then the logic is redundant:
6752 if thchange(1) then do;
6753 if thchange(1)=' ' then nonmedli=' ';
6754 else nonmedli=nonmedli3;
HTH,
Dennis Diskin
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of D
Schmid
Sent: Thursday, March 27, 2008 11:23 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Array question
Does anyone know why I get this note:
NOTE: Character values have been converted to numeric values at the
places given by: (Line):(Column).
6752:4 6756:4 6768:4 6886:4
Here is the code I am using (copied and pasted from my log):
6747 if not (nonmedli1=' ' and nonmedli2=' ' and nonmedli3=' ') then
do;
6748
6749 array thchange (3) nonmedli3 nonmedli2 nonmedli1 ;
6750 do i=1 to 3;
6751 nonmedli=' ';
6752 if thchange(1) then do;
6753 if thchange(1)=' ' then nonmedli=' ';
6754 else nonmedli=nonmedli3;
6755 end;
6756 if thchange(2) then do;
6757 if thchange(2)=' ' then do;
6758 if nonmedli ne ' ' then do;
6759 retain nonmedli;
6760 end;
6761 else nonmedli=' ';
6762 end;
6763 if thchange(2) ne ' ' and nonmedli=' ' then nonmedli=nonmedli2;
6764 else if thchange(2) ne ' ' and nonmedli ne ' ' then do;
6765 retain nonmedli;
6766 end;
6767 end;
6768 if thchange(3) then do;
6769 if thchange(3) ne ' ' and nonmedli=' ' then nonmedli=nonmedli1;
6770 else if thchange(3) ne ' ' and nonmedli ne ' ' then do;
6771 retain nonmedli;
6772 end;
6773 else if thchange(3)=' ' then nonmedli=' ';
6774 end;
6775 end;
6776
6777 end;
Can anyone explain?
Can I prevent the error message from occuring for the code above, and
how?
Thanks and best regards,
Doro
_________________________________________________________________
Watch "Cause Effect," a show about real people making a real difference.
Learn more.
http://im.live.com/Messenger/IM/MTV/?source=text_watchcause