|
Chapter Contents |
Previous |
Next |
| The ASSIGN Procedure |
A swimming coach needs to assign male and female swimmers to each stroke of a medley relay team. The swimmers' best times for each stroke are stored in a SAS data set. The ASSIGN procedure is used to evaluate the times and to match strokes and swimmers to minimize the total relay swim time. The following statements produce Output 2.3.1:
title 'Assigning Strokes Using the BY Statement';
data relay;
input name $ sex $ back breast fly free;
datalines;
SUE F 35.1 36.7 28.3 36.1
KAREN F 34.6 32.6 26.9 26.2
JAN F 31.3 33.9 27.1 31.2
ANDREA F 28.6 34.1 29.1 30.3
CAROL F 32.9 32.2 26.6 24.0
ELLEN F 27.8 32.5 27.8 27.0
JIM M 26.3 27.6 23.5 22.4
MIKE M 29.0 24.0 27.9 25.4
SAM M 27.2 33.8 25.2 24.1
CLAYTON M 27.0 29.2 23.0 21.9
;
proc assign out=fast;
cost back--free;
id name;
by sex;
proc print;
by sex;
sum _fcost_;
run;
Output 2.3.1: Assigning Strokes Using the BY Statement
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.