Hi everyone, I am trying to use an if-then statement with a variable character. I am running into a problem though where every time I run my code, the system converts my character variables into numeric variables and then defaults to the else statement. What I have is a multitude of characters from a large dataset. I only want to keep values that are 00, 26 or TC with everything else becoming 00. I initially tried the single quote since I thought that was used for characters, and then no quotes but both times everything has defaulted to 00. Here is the portion of the code that I am currently working on: data rs0; set detail; if mod_1 = '00' then modifier = '00'; else if mod_1 = '26' then modifier = '26'; else if mod_1 = 'TC' then modifier = 'TC'; else modifier = '00'; run; proc print data=rs0 label; label modifier = "Modifier"; run; There is some sorting and univariate commands between this, but I left the specific portion that I cannot get correct. If anyone could help me clear this up; it would be greatly appreciated. Thanks!
... View more