$ORDER() is the contemporary equivalent to $NEXT().  $ZORDER() would have been the equivalent to $QUERY() but I'm not sure if it existed in 1978, I think it may have been introduced a little later in DSM-11.

This would only kill variables at the current stack level.  I think you rather want to do:

%SYS 4d3>quit
%SYS>kill  zremove

Nevertheless a useful tip.  Many people don't seem to realize that they need to issue a quit to unwind the stack after an error.

Open Exchange applications:
George has not followed anybody yet.
Global Masters badges: