Previous Topic: Preventing ErrorsNext Topic: Handling Runtime Errors


Using $RC in Error Procedures

The CA Ideal system does not set $RC for the current error. If you do not code an error procedure, the default error procedure ensures that $RC is at least a value of 12. A user coded error procedure needs to set $RC to ensure a non‑zero return code upon completion of the RUN. Setting $RC is optional. Whether it is set in an error procedure or not, the CA Ideal system does not alter it.

$RC typically tests the completion status after a run. Therefore, it is most useful for batch jobs, where the execution of one run depends on the successful execution of a previous one. For more information about using $RC to control batch runs, see the section, Using CA Ideal Commands in Batch, in the Working in the Environment Guide.