I have a variable name food. food has 8 value labels ranges from 1 to 8. I want to create a variable called range by using the value level of food. let us suppose I have the dataset name as diet. data food1;
set work.diet;
if food <=2 then range=1;
else if 3<= food <=5 then range=2;
else if 6<= food <=7 then range=3;
else if 3<= food <=7 then range=4;
else if food>=8 then range=5;
run; the problem line 6 else if 3<= food <=7 then range=4 is not accounting by sas 9.4 as the value is overlapping while creating range variable. i want a variable with this overlapping code. it is creating the value label of range 1 2 3 and 5. it is not accounting the above-highlighted command. can anyone help me with this?
... View more