Technical data
USE
USE
Function
The USE statement specifies Declaratives procedures to handle file input/output
errors and database exception conditions. It can also specify procedures to be
executed before the program processes a specific report group.
These procedures supplement the procedures in the COBOL Run-Time System
and RMS.
USE is part of the COBOL ANSI standard.
Formats 1 and 2
Refer to the HP COBOL Reference Manual for Formats 1 and 2. Only Format 3
is applicable to DBMS DML.
Format 3
USE
GLOBAL
FOR DB-EXCEPTION
ON
{DBM$_exception-condition} . . .
OTHER
.
DBM$_exception-condition
is a symbolic constant name beginning with the characters DBM$_. It identifies
an Oracle CODASYL DBMS exception condition. Refer to the Oracle CODASYL
DBMS documentation set for information on DML error and warning messages.
Syntax Rules
All Formats
1. A USE statement can be used only in a sentence immediately after a section
header in the Procedure Division Declaratives area. It must be the only
statement in the sentence. The rest of the section can contain zero, one, or
more paragraphs to define the particular USE procedures.
2. The USE statement itself does not execute. It defines the conditions that
cause execution of the associated USE procedure.
3. Refer to HP COBOL Reference Manual for information on USE formats 1 and
2.
Format 3
1. The DBM$_exception-condition argument must begin with these five
characters: DBM$_.
2. If the phrase USE [GLOBAL] FOR DB-EXCEPTION. occurs, it is the only
USE procedure allowed in the program.
3. Multiple occurrences of the USE statement can exist within a program only if
the ON phrase is specified. DBM$_exception-condition in each USE statement
must be unique. Multiple USE statements must not cause the simultaneous
request for execution of more than one USE procedure. The OTHER phrase
may be specified only once in a program.
4. If a USE FOR DB-EXCEPTION statement does not specify the ON phrase,
it must be the only occurrence of Format 3 of the USE statement in the
program.
4–62 Procedure Division