End the program.

 End [ %ERROR ]
 This is the default final statement of the MAIN subroutine. An execute (or .COM file) stream can be aborted by ending with %ERROR. Ending with %ERROR returns an error status to DCL. Note that this has no impact if an IDML program is being run from another IDML program. Under this circumstance, control simply returns to the calling program. However, ending the program with %ERROR sets %STATUS to %ERROR in the calling program.
This statement causes the program that it is running in to terminate. Any open data files are closed. Any locked data files are unlocked and any locked records are unlocked. Record buffers are flushed; i.e. written to disk. If this command is executed from a library form or subroutine it will still perform the same operation on the program that originally invoked the library form or subroutine.

 If %ITEM = "END" then End ! End Normally
 End %ERROR ! Abort the execute stream