COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-283
USE
This is a sample run of Example 9-71 with a typical name and a single-word name:
Enter a name (or a space to terminate):
?Abraham Moyer
Last name is......Moyer
Rest of name is...Abraham
Enter a name (or a space to terminate):
?Johann Philip Geissinger
Last name is......Geissinger
Rest of name is...JohannPhilip
Enter a name (or a space to terminate):
?Copernicus
Last name is......Copernicus
Rest of name is...
The portions of the rest of the name are not separated by spaces. If you want spaces,
make the STRING statement look like this:
STRING NAMES (NAME-INDEX) DELIMITED BY SPACE
" " DELIMITED BY SIZE
INTO REST-OF-NAME
POINTER POINTER-1.
USE
USE defines debugging or exception-handling procedures beyond the standard
techniques of the file system. USE also defines the conditions under which the
procedure paragraphs following it are executed.
USE can appear only as the first statement of a section in the Declaratives Portion of
the Procedure Division, and it must be the only statement in the sentence containing it.
Any other statements that the section contains must be organized into sentences
belonging to paragraphs of the section. Empty debugging declarative sections serve no
purpose.
Each section containing a USE statement is a declarative procedure. A declarative
procedure, together with any associated utility sections, forms a logically discrete area.
(The other logically discrete area of a program is the remainder of the Procedure
Division.)
Control statements (ALTER, GO TO, and PERFORM) specified in one logically
discrete area are, with a few exceptions, not permitted to refer to procedure-names
defined within another logically discrete area. For the detailed restrictions and
permissions, see ALTER, GO TO, and PERFORM.
Form Description
USE DEBUGGING
Obsolete. The NMCOBOL compiler ignores it.
USE AFTER EXCEPTION
Transfers control to an error-handling procedure
when an error occurs