Date: Tue, 22 Dec 1998 09:05:17 +0000
Reply-To: Peter Crawford <Peter@CRAWFORDSOFTWARE.DEMON.CO.UK>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Peter Crawford <Peter@CRAWFORDSOFTWARE.DEMON.CO.UK>
Organization: Crawford Software Consultancy Limited
Subject: Re: How to convert character to number given a dataset in SAS
format?
In article <367f50f9.12796168@news>, christopher
<appreciate@bigfoot.com> writes
>I have found a way to solve the problem
>
>data file;
> set source_file;
> x=input(score1,2.);
> y=input(score2,2.);
>run;
>proc univariate;
> var x y;
>run;
>
>Is there any alternative way!
>
>
>
>On Tue, 22 Dec 1998 07:01:04 GMT, appreciate@bigfoot.com (christopher)
>wrote:
>
>>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
>
One problem with the SAS System documentation lies with the indexing: -
if you aren't familiar with the lingo, you'll look up the wrong word
In your original post you demonstrated this: you were not getting PUT()
to do what you wanted, because it generates character strings and you
wanted numbers - which are delivered by INPUT() like in your 2nd posting
Character data can still usefully be analysed with procedures: e.g.
although it doesn't provide a univariate analysis, the cross combination
counts can be generated directly (into data set CROSS ), with
proc summary data=<source_file> missing;
class score1 score2 ;
output out = cross ;
run;
--
Peter Crawford
|