Unexpected error message

Here is my run file:
reset;

data 1-1a.dat;

model 1-1a.mod;

solve;

Getting these unexpected errors:
1-1a.dat, line 3 (offset 16):
MEDIA is not a set
context: set >>> MEDIA <<< := TV MAG ;

1-1a.dat, line 5 (offset 65):
cost is not a subscripted param
context: param: cost reach require >>> := <<<

1-1a.dat, line 9 (offset 134):
budget is not a param (or var or constraint or objective)
context: param >>> budget <<< := 1000000 ;
ampl:

Can someone please help me understand why I am getting these errors and how to correct them? Thanks

You need to read the model file before the data file:

model 1-1a.mod;
data 1-1a.dat;
solve;

In the model file there is a statement

set MEDIA;

that defines MEDIA to be a set. Then in the data file there is a statement

set MEDIA := TV MAG ;

that gives the members of that set, for the particular case that you want to solve.