I am using if-then statements in a program I am running. I have successfully run the program using data step processing, and am now trying an alternative method using proc iml. However, the if-then statements are not working as they should when using IML. I do not recieve error messages in the log, but the results are not what they should be. Does proc iml require different language when using 'if-then' statements? Below is the code I am referring to:
if 0 <= yg < 2 then YG_SCS= YG1_Avg;
if 2 <= yg < 2.5 then YG_SCS = YG2_Avg;
if 2.5 <= yg < 3 then YG_SCS = YG2A_Avg;
if 3 <= yg < 4 then YG_SCS = YG3_Avg;
if 4 <= yg < 5 then YG_SCS = YG4_Avg;
else if yg >= 5 then YG_SCS =YG5_Avg;