$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

GT.M sets $ZSTATUS when it encounters errors during program execution, but not when it encounters errors in a Direct Mode command.

$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, FIS recommends setting it to null. M routines cannot modify $ZSTATUS with the NEW command.


Attempt to divide by zero

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