you have 3 mistakes.
On line 21 it should be "read(x.d)" "d" is field of a record. You need to specify the record variable which is "x".
Similarly, on line 23, it's "read(x.n)" because "n" is a field of record variable "x".
Once you correct those two problems the compiler will let you know that it cannot "write variables of that type" in line 39. That line should read:
for i:=1 to z do writeln(ds[i].d, ds[i].n);
the compiler doesn't know how to write a record. It can only write fields (provided they are of a type it knows how to write.)
HTH.