REWRITE Collection Statement

Overwrites an element in the list or dictionary.


Where: identifier is the name of the list or dictionary collection type.

Note: Other formats of this statement are available. See Statements in the COBOL Language Reference.


The following overwrites the first element in the list stringList.

       rewrite stringList from "ITEM REWRITE" key 0
       display "The contents of the list after rewrite element 0 : "           
       invoke displayListContents(stringList)

See also the Collections sample, which is available from $COBDIR/demo.