the feet in a number and inches in a number. I got errors. So I tried this: ODS HTML close; ODS listing ; data a (keep= id mrn ht2mg ) out=b; set aung.try_ht2; run; proc print data=b noobs; run; data c (drop=t1); set b; feet=input(compress(scan(ht2mg,1,"'")),3.); t1=index(ht2mg,"'"); inches=(compress(scan(substr(ht2mg,t1+1),1,'"')),3.); run; proc print data=c; run; I don't understand what the t1 means. I do thank you for your code, but I have thousands to do. I can separate the id and mrn with ht2mg (text var) into a separate database, but is there an easier way? The code above did not work. I got these errors: 250 251 252 data c (drop=t1); 253 set b; 254 255 feet=input(compress(scan(ht2mg,1,"'")),3.); 256 t1=index(ht2mg,"'"); 257 inches=(compress(scan(substr(ht2mg,t1+1),1,'"')),3.); - 22 200 ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, ), *, **, +, -, /, <, <=, <>, =, >, ><, >=, AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=. ERROR 200-322: The symbol is not recognized and will be ignored. 258 run; NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column). 257:9 NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.C may be incomplete. When this step was stopped there were 0 observations and 5 variables. WARNING: Data set WORK.C was not replaced because this step was stopped. NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.01 seconds thank you.
... View more