IB Statements/rewrite

From CometWiki

Jump to: navigation, search

REWRITE statement

Syntax: REWRITE (lun, format-statement-label) KEY=index [,EXCP=statement-label | NOEXCP]

Discussion: The REWRITE statement functions just like the WRITE statement, except that an exception is reported if the record does not already exist. REWRITE can be used only on keyed files.

Example: REWRITE (1,400) KEY=KEYNO$,EXCP=1600

In this example, the REWRITE statement is used to rewrite the data record defined in format-statement-label 400. If the record does not already exist, the exception branch is taken.

Personal tools