data codes to create variables */ data salesl ; set mysales ; date = datepart (Invoicedate); yearmm = year (date) *100+month(date); UnitPrice* Quantity; total sale month month (date); quarter = qtr (date); itemID=1*substr(StockCode, 1, 2); if itemID = then delete; 1_date= '31DEC2011'D ; format date 1_date mmddyy10. ; if country = "United Kingdom" then UK = 1; else UK = 0; if totalsale = then delete ; run ;
Fig: 1