Hello, I am trying to convert a variable from a character to a numeric variable. The original character variable has numeric values, special symbols ":, *), numeric values with symbols ">3, -3, >=10", and text such as "see comment" and " ____MARKED". Ultimately, I want to convert this to a numeric variable because I will need to do summary statistics on it later. However, I do need to keep the "-3" the other values such as ">3" can become "3". I wrote the following program: DATA L1; LENGTH RV $ 100; SET Labs; RESULT_VALUE = COMPRESS(RESULT_VALUE,'<> >=+'); IF RESULT_VALUE IN('' ':') THEN RV = ''; ELSE RV=RESULT_VALUE; IF anyalpha(RV) THEN DELETE; ELSE RV = INPUT(RV, 12.); RUN; I was able to successfully remove the text values and symbols, but, "-3" got converted to "3" and the variable is still character. Additionally, on doing a subsequent PROC FREQ it the original variable "result_value" is missing its original text and special values which I thought should not happen. Could you please help me understand how to do this differently? Thank you.
... View more