Reformatting Data type in SAS
Posted: 06 December 2011 02:44 PM   [ Ignore ]
Newbie
Rank
Total Posts:  2
Joined  2011-12-06

I am having trouble reformatting a column from “character” to “numeric”. I tried the below code with my variable being “Relevanc”:
data Folder.File1;
set Folder.File1;
format RELEVANC Best15.;
run;

SAS returned error on the “BEST15.” portion of the code. I have tried “Best8.” and a few others as instructed by “The Little SAS Book”. Any help to change the variable “type” would be great.

Profile
 
 
Posted: 06 December 2011 04:37 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi,

Instead of changing the formatting (which is how the variable is shown), you want the variable to change.

Both of these should work:

REL_NUM = 1 * RELEVANC;

or,

REL_NUM = input (RELEVANC, BEST15.);

hope this helps,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile