ampl: set destination;
ampl: set times;
ampl: param dem {destination,times};
ampl: data;
ampl data: set destination := NY MD TX ;
ampl data: set times := 1 2 3 4 5 ;
ampl data: model;
ampl: table fleetdemand IN "ODBC" "travel.xls" "demand":
ampl? [i ~ destination], {j in times} <dem[i,j] ~ (j)>;
ampl: read table fleetdemand;
ampl: option display_1col 0;
ampl: display dem;
dem [*,*] (tr)
: MD NY TX :=
1 3 0 0
2 0 0 2
3 0 1 0
4 0 0 2
5 0 0 0
;
Note that I defined the range "demand" to encompass only the four rows and
six columns of the spreadsheet that contained the table.
Bob Fourer
4...@ampl.com