$ZStatus

$ZS[TATUS] contains a string value specifying the error condition code and location of the last exception condition that occurred during routine execution.

GT.M maintains $ZSTATUS as a string consisting of three or more substrings. The string consists of the following:

    Format: %<FAC>-<SEV>-<ID>, <TEXT>
    Example: %GTM-E-DIVZERO, Attempt to divide by zero
    

The DCL command SET MESSAGE does not affect the format of the $ZSTATUS string. $ZSTATUS always contains all components of the VMS error message format (message number, facility, error severity, identification and text). GT.M sets $ZSTATUS when it encounters errors during program execution, but not when it encounters errors in a Direct Mode command.

When a VMS system component such as RMS detects an error, the error message number is a VMS condition code. When a GT.M system component detects an error, the message number is a GT.M condition code. You can establish your own condition codes using the VMS MESSAGE utility and invoke them using the GT.M ZMESSAGE command. For more information on GT.M condition codes, refer to the "GT.M Messages & Recovery Manual". For more information on the VMS message facility, refer to the VMS Message Utility Manual. For more information on error handling, refer to the "Error Processing" chapter in this manual.

$ZSTATUS is a read-write Intrinsic Special Variable, (i.e., it can occur on the left side of the equal sign (=) in the argument to the SET command). While it will accept any string, Sanchez Computer Associates recommends setting it to null. M routines cannot modify $ZSTATUS with the NEW command.

Example:

    GTM> WRITE $ZSTATUS
    1212,+1^GTM$DMOD,%SYSTEM-F-FLTDIV_F,
    arithmetic fault, floating
    divide by zero at PC=00080C01, PSL=03C00000
    

This example displays the status generated by a divide by zero (0).