Date: Tue, 20 Jun 2006 07:07:48 -0700
Reply-To: TK <Tony.Kelleher@CSO.IE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: TK <Tony.Kelleher@CSO.IE>
Organization: http://groups.google.com
Subject: Re: Working on String mathematical expressions
In-Reply-To: <46638d360606200015if3b62f0y9a408de3d76e69ab@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi,
I have amended Guido T's code a little as you say that you want your
new variable to be numeric. Both yours and Guido T's code have the new
variable as a character one. See change in the length statement and
use of the INPUT function below:
data x;
length var1 $100;
input var1 & $;
y = input (resolve('%eval('||var1||')'),8.);
cards;
1+ 2 + 3
(3 + 4 ) * 5
(30 - 20) + 100
;
run;
Regards,
Tony
|