In this post, I will discuss about the “If and then Statements in SAS”. Here , I have created the dataset where I have mentioned emp_id in numbers as well as single character. See the below SS related to Dataset created.
Now, on the above dataset I will apply If and then statement and assign numbers to single character emp_id. See the below code for the same.
IF EMP_ID="A" THEN EMP_ID= "1";
ELSE IF EMP_ID="B" THEN EMP_ID= "2";
Once you execute the above code, the below output will appear.