21-Nov-2002

OpenVMS condition values

OpenVMS has a consistant calling standard enabling any language that conforms to that standard to call other modules written in any other language that also conforms.

One major piece of glue, and one of the nicest things about programming on OpenVMS is that the condition values returned from a conforming module must use a standard to indicate success or failure.

Learn this standard, and it can be applied to every API that the operating system supplies.

To summarise, each conforming module returns a 32 bit unsigned integer as an indication of its overall status. The low three bits of this integer indicate the severity of the status:

  • 0 - Warning - this code is used whenever a procedure produces output, but the output produced might not be what the user expected (for example, a compiler modification of a source program).
  • 1 - Success - Indicates that the procedure generating the condition value completed successfully, as expected.
  • 2 - Error - Indicates that an error has occurred but the procedure did produce output. Execution can continue, but the results produced by the component generating the condition value are not all correct.
  • 3 - Informational - Indicates that the procedure generating the condition value completed successfully but has some parenthetical information to be included in a message if the condition is signaled.
  • 4 - Fatal - Indicates that a severe error occurred and the component generating the condition value was unable to produce output.

To determine the success of failure of a call, the calling program mearly performs a low bit test on the returned condition code. Success and informational are treated as success, and warning, error, and fatal are treated as failure.

Further information on the calling standard and condition values may be obtained from "The OpenVMS Calling Standard", an HTML version of the document.

Programmers can define their own condition codes. A compilable language is available to perform this task. Further information on this can be found in this manual.

Posted at November 21, 2002 9:48 AM
Tag Set:

Comments are closed