A further requirement of Tradewinds
Travel is a separate SAS data set that contains the tour that generated
the most revenue. (The revenue total equals the price of the tour
multiplied by the number of bookings.) One method of creating the
new data set might be to follow these three steps:
Calculate the revenue
in a DATA step.
Sort the data set in
descending order by the revenue.
Use another DATA step
with the OBS= data set option to write that observation.
A more efficient method compares the revenue from all observations in a single DATA step. SAS can retain a value from the current observation to use in future observations. When the processing of the DATA step reaches the next observation, ...