Nothing is displayed in console

I have tried to solve a simple minimization problem in AMPL like so:

.mod:

set PARTS; 		# set of parts we can produce
set MACHINES;	# set of machines that produces parts

param cap {MACHINES} >= 0;			# capacity of production for each machine
param req {PARTS} >= 0; 			# required amount of each part
param cost {MACHINES, PARTS} >= 0;	# cost for machine m to produce part p

var Produce {MACHINES, PARTS} >= 0; # how many of part p does machine m produce

minimize Total_Cost: sum {m in MACHINES, p in PARTS} Produce[m,p] * cost[m,p];

s.t. Capacity {m in MACHINES}: sum {p in PARTS} Produce[m,p] <= cap[m]; # we do not produce more than cap
s.t. Required {p in PARTS}: sum {m in MACHINES} Produce[m,p] >= req[p]; # we do not produce less than required

.dat:

param:  MACHINE:	cap	:=
		1			80
		2			30
		3			70;

param:	PARTS:	req	:=
		1		10
		2		40
		3		60
		4		20
		5		20
		6		30;
		
param cost :
			1	2	3	4	5	6	:=
		1	3	3	2	5	2	1
		2	4	1	1	2	2	1
		3	2	2	5	1	1	2;

.run:

reset;
model machineparts.mod;
data machineparts.dat;
solve;
display {m in MACHINES}: {p in PARTS} Produce[m,p];

But when I run the line include machineparts.run; in the console this is all I get:

ampl: include machineparts.run
ampl:

As you can see, nothing is displayesd. I have tried writing the run file like this:

reset;
model machineparts.mod;
data machineparts.dat;
solve;
display Produce;

But I still get no output in console. What am I doing wrong?

You should be getting the following error:

ampl: include machineparts.run;

machineparts.dat, line 1 (offset 15):
	MACHINE is not a set
context:  param:  MACHINE >>> : <<< 	cap	:=

What are you using to run AMPL from? Is it some terminal or the IDE?

If you put the following in machineparts.dat it should work:

set MACHINES := 1 2 3;

param:  MACHINES:	cap	:=
		1			80
		2			30
		3			70;

param:	PARTS:	req	:=
		1		10
		2		40
		3		60
		4		20
		5		20
		6		30;
		
param cost :
			1	2	3	4	5	6	:=
		1	3	3	2	5	2	1
		2	4	1	1	2	2	1
		3	2	2	5	1	1	2;

It should then produce the following output:

ampl: include machineparts.run;
MINOS 5.51: optimal solution found.
9 iterations, objective 260
Produce[1,p] [*] :=
1   0
2   0
3  50
4   0
5   0
6  30
;

Produce[2,p] [*] :=
1   0
2  20
3  10
4   0
5   0
6   0
;

Produce[3,p] [*] :=
1  10
2  20
3   0
4  20
5  20
6   0
;
1 Like