BookmarkSubscribeRSS Feed
srikanthyadav44
Quartz | Level 8

dear all 

i have 40 different variables in my dataset. 

some of the variables are in character form and some are numeric. 

I have to convert all tthe variables into numeric form. 

how to do it in SAS.

 

thanks in advance. 

 

3 REPLIES 3
srikanthyadav44
Quartz | Level 8

dear 

i tried the following code from the link suggested by you. 

But it is not working.

data test2;                                               
   set test;                                                 
   array ch(*) $ &c_list;                                    
   array nu(*) &n_list;                                      
   do i = 1 to dim(ch);                                      
      nu(i)=input(ch(i),8.);                                  
   end;                                                      
   drop i &c_list;                                           
   rename &renam_list;                                                                                      
run;   

there are some other codes also. but i could not understand them. 

i am attaching the error displayed by SAS

please help me solving the problem

thanks in advance

 

Kurt_Bremser
Super User

Ideally, you do that when you import the data into SAS by making sure that the values are read correctly.

 

How did you receive the data, and how did you import it?

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 398 views
  • 0 likes
  • 3 in conversation