/* BuildSchedule.sas */ /* This SAS program creates a 44,060 observation SAS data set for the */ /* Optimising SAS Programs class. */ /* Change the information in single quotes to the storage location for the */ /* class data sets. */ libname ia 'c:\workshop\winsas\effi'; /* This data step runs through the one-day ia.BuildSchedule data set and */ /* creates an observation for every day of the year for each flight in */ /* the original ia.BuildSchedule data set. In addition, the data is built */ /* only for the current year. A copy of BuildSchedule is created with */ /* January 1st of the current year as the value for ScheduledDate. */ data ia.Schedule; set ia.BuildSchedule; retain date; if _n_ = 1 then date = mdy( 1, 1, year(today()) + 1); ScheduledDate = mdy(1, 1, year(today())); do while (ScheduledDate lt date); output ia.Schedule; ScheduledDate + 1; end; drop date; run; /* Sort the Schedule data set so it is in order by RouteStart. */ proc sort data = ia.Schedule; by RouteStart; run; /* This data step runs through the ia.SESchedule data set and creates */ /* data only for the current year. */ data ia.SESchedule ; set ia.SESchedule; month = month(ScheduledDate); day = day(ScheduledDate); year = year(today()); ScheduledDate = mdy(month, day, year); run;