|
Chapter Contents |
Previous |
Next |
| The ASSIGN Procedure |
Suppose that the data from Example 2.1
are transposed so that variables are jobs.
Then each observation contains the profit from awarding each job
to a single subcontractor. The following program finds the maximum
profit assignment and produces Output 2.2.1:
title 'Assigning Construction Jobs to Subcontractors';
data profit;
input subcont $ job1-job9;
cards;
SUBCON1 79 43 29 88 65 44 35 50 25
SUBCON2 24 59 52 83 90 79 51 12 17
SUBCON3 13 33 0 64 56 86 -9 59 39
SUBCON4 53 95 27 72 62 93 91 32 .
SUBCON5 47 55 13 0 53 71 39 23 38
SUBCON6 66 97 33 67 91 7 32 64 63
SUBCON7 85 34 0 27 48 86 32 0 87
SUBCON8 17 55 11 47 23 59 12 94 14
SUBCON9 92 84 71 83 6 0 79 97 4
SUBCON10 47 94 86 62 89 56 25 14 18
SUBCON11 46 26 6 35 49 45 79 11 11
SUBCON12 13 56 76 38 33 59 81 97 45
;
proc assign maximum data=profit;
cost job1-job9;
id subcont;
run;
proc print;
sum _fcost_;
run;
The cost of the optimal assignment written to the SAS log is
NOTE: The maximum return assignment yields 814.
This means that the contractor can expect a profit of $814 if the optimal assignment is followed.
Output 2.2.1: Assigning Subcontractors to Construction JobsThe macro variable _ORASSIG defined by PROC ASSIGN contains information regarding the termination of the procedure.
This information can be useful when you use PROC ASSIGN as part of a larger SAS program. For example, the following information is written to on the log using the macro language with the statement:
%put &_orassig;
On the log the following appears
Output 2.2.2: _ORASSIG macro variableSTATUS=SUCCESSFUL OBJECTIVE=814.
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.