Date: Thu, 24 Dec 1998 01:00:01 -0000
Reply-To: "Andrew J. L. Cary" <ajlcary@CARYCONSULTING.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: "Andrew J. L. Cary" <ajlcary@CARYCONSULTING.COM>
Subject: Re: How to convert character to number given a dataset in SAS
format?
Much better code that won't give all sorts of converting character variable to
numeric messages and will actually convert the
values to numeric is: (untested code)
data temp;
set source.data (rename=(score1=cscore1 score2=cscore2));
score1 =input(cscore1,Best16.);
score2 =input(cscore2,best16.);
drop cscore1 cscore2;
run;
z meis example would take the character value of score1 multiply it by 1 into
a numeric variable then turn it back into a
character variable (since that is what score1 is defined as by the set
statement.).
-----------------------------------------------------------
Andrew J.L. Cary
Chief Curmudgeon
Cary Consulting Systems
http://www.caryconsulting.com
z mei wrote in message <75rp7o$1lc$1@news.interlog.com>...
>data temp;
> set source.data;
> score1=score1*1;
> score2=score2*1;
>run;
>Zhen
>
>
>christopher wrote in message <367f42e1.9188247@news>...
>>Hi,
>>I need to run
>>
>>proc univariate;
>> var score1 score2;
>>run;
>>
>>but score1, score2 are in character format. I have try to use PUT to
>>do convertion but in vain. So please give me some hints.
>>
>>Thanks
>
>