SOS I have a test tomorrow

I get the syntax error code for the total code as follow. and I couldn’t figure it out. Please help

reset;
option solver cplex;

param N>=0;
set NODES;

# Define parameters

param supply{NODES};
param profit{NODES};
param cost{NODES, NODES} >=0;
param link{NODES, NODES} binary;

# Decision variables

var x{NODES} binary;
var y{NODES,NODES} binary;

# Objective function

maximize z: 
  sum {i in NODES} profit[i] * x[i] - 
  sum {i in NODES, j in NODES} cost[i,j] * y[i,j];

# Constraints

s.t. linkingflow{i in NODES}: sum{j in 1..N} y[i,j] - x[i] >= 0;
s.t. factorylink{0 in NODES}: sum{j in NODES} y[0,j] >= 1;
s.t. bothsection{i in NODES, j in NODES}: y[i,j] <= x[i] and y[i,j] <= x[j];

data MSTapproach.dat;

In your factorylink constraint, it is an error to write 0 in NODES, because 0 is not a valid name for a set index. In fact, to fix this constraint, you can just remove 0 in NODES:

s.t. factorylink: sum{j in NODES} y[0,j] >= 1;

There is only one factorylink constraint, so no indexing is required for it.