IMSL Statistics Reference Guide > Utilities > CMAST_ERR_TRANS Function (PV-WAVE Advantage)
  

CMAST_ERR_TRANS Function (PV-WAVE Advantage)
Determines if an Informational Error has occurred.
Usage
result = CMAST_ERR_TRANS(arg)
Output Parameters
arg—Can be either a scalar string specifying a particular Informational Error or an integer specifying the internal code of an Informational Error.
Returned Value
result—If arg is a scalar string specifying a valid Informational Error, then the return value is the integer error-code value of the Informational Error. If arg is an integer specifying a valid Informational Error code, then a string specifying the Informational Error is returned.
Discussion
Function CMAST_ERROR_TRANS is designed to check programs for specific Informational Errors. PV‑WAVE IMSL Statistics statistical functions attempt to detect user errors and handle them in a way that provides as much information to the user as possible. To do this, five levels of Informational Error severity, in addition to the basic PV‑WAVE IMSL Statistics Reference error-handling facility, are recognized. Following a call to a mathematical or statistical function, the system variables !Error and !Cmast_Err contain information concerning the current error state. Variable !Error contains the error number of the last error, and !Cmast_Err is set either to zero, which indicates that an Informational Error did not occur, or to the error code of the last Informational Error that did occur.
The user can interact with the PV‑WAVE IMSL Statistics error‑handling system with respect to Informational Errors in two ways: (1) change the default printing actions and (2) determine the code of an Informational Error so as to take corrective action. To change the default printing action, the system variable !Quiet is set to a nonzero value. To allow for corrective action to be taken based on the existence of a particular Informational Error, function CMAST_ERR_TRANS retrieves the integer code for an Informational Error given a scalar string specifying the name given to the error.
In the program segment below, the Cholesky factorization of a matrix is to be performed. If it is determined that the matrix is not nonnegative definite (and often this is not immediately obvious), the program is to take a different branch.
; Call CHNNDFAC with a matrix that may not be nonnegative
; definite.
x = CHNNDFAC, a, fac
; Check system variable Cmast_Err to see if it contains the
; error code for the error MATH_NOT_NONNNEG_DEFINITE. 
IF (CMAST_ERROR_TRANS('MATH_NOT_NONNNEG_DEFINITE') EQ $
   !Cmast_Err))$
THEN ;... Handle matrix that is not nonnegative definite.

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.