Hi there!
So I had to make three temporary data sets in one data step as well as create a new variable named ShipDays (that is the number of days between when the order was placed and when the order was delivered). I got this part done no problem..
But then it asks to : Output to ‘QUICK’ when the value of ShipDays is less than 3.
Output to ‘SLOW’ when the value of ShipDays is 3 to 5.
Output to ‘VERYSLOW’ when the value of ShipDays is greater than 5.
this is what i have:
data quick
slow
veryslow;
set orders;
where Order_Type_Label in ("Web", "Catalogu");
ShipDays = Delivery_Date - Order_Date;
run;
How do I do this? IF THEN statement? but I'm not sure what to put after THEN. thanks for any help 🙂
data quick slow veryslow; set orders; where Order_Type_Label in ("Web", "Catalogu"); ShipDays = Delivery_Date - Order_Date; if ShipDays lt 3 then output quick; else if Shipdays le 5 then output slow; else if Shipdays gt 5 then output veryslow; run;
Art, CEO, AnalystFinder.com
data quick slow veryslow; set orders; where Order_Type_Label in ("Web", "Catalogu"); ShipDays = Delivery_Date - Order_Date; if ShipDays lt 3 then output quick; else if Shipdays le 5 then output slow; else if Shipdays gt 5 then output veryslow; run;
Art, CEO, AnalystFinder.com
FYI: output is a statement .. not a function. All functions are in the form functionname()
Art, CEO, AnalystFinder.com
@sammydouglas wrote:
Hi there!
So I had to make three temporary data sets in one data step as well as create a new variable named ShipDays (that is the number of days between when the order was placed and when the order was delivered). I got this part done no problem..
But then it asks to : Output to ‘QUICK’ when the value of ShipDays is less than 3.
Output to ‘SLOW’ when the value of ShipDays is 3 to 5.
Output to ‘VERYSLOW’ when the value of ShipDays is greater than 5.
this is what i have:
data quick
slow
veryslow;set orders;
where Order_Type_Label in ("Web", "Catalogu");
ShipDays = Delivery_Date - Order_Date;
run;
How do I do this? IF THEN statement? but I'm not sure what to put after THEN. thanks for any help 🙂
data Quick1(where=(ShipDays<3)) Slow (where=(3<=ShipDays<5)) veryslow (where=(ShipDays>5));
set orders;
where Order_Type_Label in ("Web", "Catalogu");
ShipDays = Delivery_Date - Order_Date;
run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.