Previous Topic: Common Error SubroutinesNext Topic: Using $RC in Batch


Detecting the Severity of the Error Using $RC

In most cases, the execution of CA Ideal commands sets $RC to a specific value. The CA Ideal system sets $RC, except when a RUN command is invoked. When the CA Ideal system determines it, $RC reflects the highest severity of errors in a session as follows:

Error Type

Return Code Value

No error

0

Advisory or warning

4

Error

8

Fatal error

12 or more

The value of $RC is transmitted to the output file at the end of every run. You can evaluate this value to determine the outcome of the run. The default error procedure sets the value of $RC to 12. A coded error procedure can set the value of $RC as appropriate. To determine what value to assign to $RC, several functions are available. You can use these functions to define category, type, and severity of the error.

During online execution, the value of $RC should be initialized to 0 when an application is invoked.