Hi all! below is my code. So the code with the if statement works totally fine. I was trying to do the same thing using a select statement, but I got 0 observations except for ShipDays<3. Does anyone know what's wrong? data work.fast work.slow work.veryslow; set hw2.allorders; where Order_Type=2 or Order_Type=3; ShipDays=Delivery_Date-Order_Date; if ShipDays<3 then output work.fast; else if ShipDays>7 then output work.veryslow; else if ShipDays>5 and ShipDays<7 then output work.slow; drop Employee_ID; run; /*problem1 part b*/ data work.fast work.slow work.veryslow; set hw2.allorders; where Order_Type=2 or Order_Type=3; ShipDays=Delivery_Date-Order_Date; select(ShipDays); when (ShipDays<3) output work.fast; when (ShipDays>7) output work.veryslow; when ((ShipDays>5)and(ShipDays<7)) output work.slow; otherwise; end; drop Employee_ID; run;
... View more