LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2005, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 24 Jul 2005 11:22:27 -0400
Reply-To:     Arthur Tabachneck <art297@NETSCAPE.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:      Re: How to transfer character variables into numeric variables by
              using DO LOOP¡H
Comments: To: "subscribe sas-L Chen, Chiu-Chen" <angelina.aml@YAHOO.COM.TW>
Content-Type: text/plain; charset=ISO-8859-1

Would the following do what you want?

data chen; input a $ b $ c $; cards; 1 2 3 a 4 5 6 b 7 8 c d ; run; data chen; set chen; array XXX[*] _character_; array YYY[3]; do kk=1 to DIM(XXX); YYY[kk]=input(XXX[kk],1.); end; run;

Art --------- On Sun, 24 Jul 2005 04:57:04 -0400, subscribe sas-L Chen, Chiu-Chen <angelina.aml@YAHOO.COM.TW> wrote:

>I have some mixed columns in an Excel data. So I read all variables into >SAS as character variables. Now I want to transfer all character variables >to numerical variables, but how should I write the program¡HI wrote the >following program, but it doesn't work. Can anybody tell me where is wrong >or how to write correctly¡H > > data chen; > set chen; > array XXX[*] _character_; > do kk=1 to DIM(XXX); > XXX[kk]=input(XXX[kk],1.); > end; > run;


Back to: Top of message | Previous page | Main SAS-L page