SAS procedure IF THEN ELSE loop did not recognize the Roman letters or numbers as value
I have written the following SAS procedure to display Grades based on the salary:
Not Working: This displays only 'I' for all observations irrespective of the else condition that says any salary less than 35000 should have a Grade as 'II'
DATA Test (Keep = FirstName LastName Salary Grade);
set orion.sales;
if salary 35000 then grade = 'I'; /* Did not interpret 'I' */
else grade = 'II'; /* Did not interpret 'II' */
run;
proc print data = test;
run;
Working:
DATA Test (Keep = FirstName LastName Salary Grade);
set orion.sales;
if salary 35000 then grade = 'G1'; /* interprets 'G1' */
else grade = 'G2'; /* interprets 'G2' */
run;
proc print data = test;
run;
So basically, the SAS did not interpret the Roman letters or numbers. Does anyone has an idea of why this is happening or any workaround to display the Roman numbers or letters?
Category Data Science