SUBROUTINE APPLIC( STATUS ) ... <application code> ... END
where the argument STATUS is given as SAI__OK. When the application ends and returns control to the environment, the final value of STATUS will reflect whether or not the application finished on an error condition. This provides the environment with a status to be associated with the application as a whole. The exit status of the application can be used by the environment to decide what to do next. If a status value other than SAI__OK is returned to the ADAM environment, then any pending error messages are output. Applications which fail should therefore return an error status. This recommendation does not, in fact, differ from that for any other subroutine obeying the inherited status strategy.
MERS (MSG and ERR) Message and Error Reporting Systems