Hint: A $ETRAP that only jumps to a label is what Set $ZTrap = "{label}" does; $ZTRAP is scoped to this frame, where $ETRAP is inherited by callees
A $ETRAP whose code is a single Goto Label does what Set $ZTRAP = "Label" does, and
ascot checks it as that handler, which is how it can check it at all. The two differ in
scope: $ZTRAP is this frame’s handler, $ETRAP is inherited by the frames it calls. IRIS
compiles and runs either. If the inherited scope is wanted, the code is right as it stands;
if only this frame is meant, $ZTRAP says so.
IRIS compiles the example.
ROUTINE Demo.ETrapGoto
Main
Set $ETrap = "Goto Fail" //! A1765
Set rate = ^Demo.ETrapGoto("rate")
Write rate, !
Quit
Fail
Write "no rate: ", $ZError, !
Quit