There is one table,
called INCENTIVES, that contains information about sales data. There
is one record for each salesperson that includes a department code,
a base pay rate, and sales of two products, gadgets and whatnots.
data incentives;
input @1 Name $18. @20 Department $2. Payrate
Gadgets Whatnots;
datalines;
Lao Che M2 8.00 10193 1105
Jack Colton U2 6.00 9994 2710
Mickey Raymond M1 12.00 6103 1930
Dean Proffit M2 11.00 3000 1999
Antoinette Lily E1 20.00 2203 4610
Sydney Wade E2 15.00 4205 3010
Alan Traherne U2 4.00 5020 3000
Elizabeth Bennett E1 16.00 17003 3003
;
proc sql;
title 'Sales Data for Incentives Program';
select * from incentives;
quit;
Sample Input Data to Conditionally Change a Table
You want to update the
table by increasing each salesperson's payrate (based on the total
sales of gadgets and whatnots) and taking into consideration some
factors that are based on department code.
Specifically, anyone
who sells over 10,000 gadgets merits an extra $5 per hour. Anyone
selling between 5,000 and 10,000 gadgets also merits an incentive
pay, but E Department salespersons are expected to be better sellers
than those in the other departments, so their gadget sales incentive
is $2 per hour compared to $3 per hour for those in other departments.
Good sales of whatnots also entitle sellers to added incentive pay.
The algorithm for whatnot sales is that the top level (level 1 in
each department) salespersons merit an extra $.50 per hour for whatnot
sales over 2,000, and level 2 salespersons merit an extra $1 per hour
for sales over 2,000.