Error running data mod (d is not a param (or var or constraint or objective))

Hi Im running AMPL on a mac and Im trying to solve an LP model using AMPL. I keep running to this error constantly where it says: "d is not a param (or var or constraint or objective)
context: param >>> d <<< := "
My line of code for the data mod is:

param d:=
1 30
2 15
3 15
4 25
5 33
6 40
7 45
8 45
9 26
10 14
11 25
12 30;

and the other code for LP model:

var X{1..12} >= 0; 
var Y{1..12} >= 0;
var Z{1..12} >= 0;
param d{1..12};

minimize cost: sum{t in 1..12} (32*X[t] + 40*Y[t] + 5*Z[t]);

subj to constraint1{t in 1..12}:
	X[t] <= 30;

subj to constraint2{t in 1..12}:
	Y[t] <= 15;

subj to constraint3{t in 1..12}:
	Z[t-1] + X[t] + Y[t] = d[t] + Z[t];

subj to constraint5:
	Y[0] = 2;  

Please help.

This error occurs when you try to read the data before the model. You could put the LP model code — everything from var X through the definition of constraint5 — into a file named, say, lp.mod. Then you could put that data beginning with param d := into a file lp.dat. Finally, you could solve the LP with the commands

model lp.mod;
data lp.dat;
solve;