OpenVMS System Management Guide, 2nd Edition

Use Digital Command Language (DCL) batch jobs to schedule routine system-management tasks
Develop error handling and restart capabilities for automated procedures
A number of system-management tasks must be performed on a regular basis. Rather than leaving these tasks to chance, you should create batch jobs that are automatically submitted at the required time. For example, system log files (see chapter 10) should be closed and archived on a regular basis. Instead of performing this task manually, create a batch job and schedule it to run automatically once a month.
An automated batch procedure must be more robust than a DCL command procedure that you run interactively. When executing a procedure interactively, you constantly watch for error messages and decide how to proceed. Because batch jobs do not automatically notify you when there is a problem, you need to include additional code to handle error reporting and recovery. You should also include code to mail error messages to SYSTEM to assure the problem does not go unnoticed.
This chapter also discusses the process of incorporating error handling and job restart capabilities into DCL command procedures.
Every time you execute a DCL command, OpenVMS returns a severity level and stores it in the symbol $SEVERITY. Table 12.1 summarizes the different severity levels that indicate the completion status of the executed command.
| Severity Level | Completion Status | Description |
|---|---|---|
| 0 | WARNING | A noncritical error or unusual condition |
| 1 | SUCCESS | Normal... |