- Sometimes, a programmer have to convert few lab results (variable: which are in character) to numeric form.
- These variables may contain numbers(123456789.) as well as special characters(*/()*&%$,:'+-<>") and alphabets.
- In such case, the following code does the numeric conversion of that variable:
if indexc(result,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz*/()*&%$,:'+-<>") = 0 and result ne " " then do;
numericresult=input(result,best.);
end;
No comments:
Post a Comment