HELP! ERROR: Thermo keyword in variable requires thermo to use

I am learning to use lammps and i am trying to run some examples, i found next
example and i have the following error:

ERROR: Thermo keyword in variable requires thermo to use/init pe
(../thermo.cpp:1052)

what is wrong with it?

my input file is:

units metal
atom_style atomic

variable x index 5.4305 5.4306 5.4307 5.4308 5.4309 5.4310 5.4311 5.4312 5.4313
5.4314
lattice diamond $x
region box block 0 3 0 3 0 3 units lattice
create_box 1 box
create_atoms 1 box

pair_style sw
pair_coeff * * Si.sw Si
mass 1 28

compute eng all pe/atom

timestep 0.005
thermo 10
thermo_style custom step pe press

variable P equal pe

dump 1 all cfg 1 a*.cfg id type xs ys zs
print "\{x\} {P}"
clear
next x
jump in.Silicon

Thermo keywords are initialized only after a run/minimize command.
Add a "run 0" after the variable command.

Ray