I have a column of data(visited_store) which have a mix of numeric, character and missing values. Example: "Yes", "No", 99,100, . I would like to create another column, and assign Yes to 1 and all other values to 0. I tried the following code: data clean_data; set original_data; if visited_store in ( . , 99, 999, 9999) then visited_store_clean = 0; if visited_store = "No" then visited_store_clean = 0; if visited_store = "Yes" then visited_store_clean = 1; RUN; Does not seem to work. Any help on how i can select rows with "No", missing value ( . ) and numeric values to 0, while "Yes" to 1?
... View more