Multiple Execute Commands
Syntax pasted from dialog boxes or copied from the log or the journal
may contain EXECUTE
commands. When you run commands
from a syntax window, EXECUTE
commands are generally
unnecessary and may slow performance, particularly with larger data
files, because each EXECUTE
command reads the entire
data file. For
more information, see EXECUTE and Command Order.
Lag Functions
One notable exception is transformation commands that contain lag
functions. In a series of transformation commands without any intervening EXECUTE
commands
or other commands that read the data, lag functions are calculated
after all other transformations, regardless of command order. For
example,
COMPUTE lagvar=LAG(var1).
COMPUTE var1=var1*2.
and
COMPUTE lagvar=LAG(var1).
EXECUTE.
COMPUTE var1=var1*2.
yield very different results for the value of lagvar, since the former uses the transformed value of var1 while the latter uses the original value.