You show here only the beginning of an AMPL model:
set SURGERY;
set ROOM;
param tour > 0 integer;
var Assign{SURGERY, ROOM, 1..tour} binary;
Before you can use writetable to send the values of the variables to a spreadsheet, you need to define an objective function (using a minimize or maximize statement) and constraints (using subjectto statements); then you need to read data for SURGERY, ROOM, and tour; and finally you need to set a solver, and invoke AMPL’s solve command to get optimal values for the Assign variables.
In particular, if you have not read data for the SURGERY set, you will get the “no data for set SURGERY” message when you try to execute writetable.
If you are defining a complete model and are doing all of the steps described above, but you are still getting the “no data” message, then to get more help, reply with all of your files attached.