LOCAL-STORAGE SECTION
The LOCAL-STORAGE SECTION defines storage that is allocated and freed on a per-invocation basis.
On each invocation, data items defined in the LOCAL-STORAGE SECTION are reallocated. Each data item that has a VALUE clause is initialized to the value specified in that clause.
For nested programs, data items defined in the LOCAL-STORAGE SECTION are allocated upon each invocation of the containing outermost program. However, each data item is reinitialized to the value specified in its VALUE clause each time the nested program is invoked.
For methods, a separate copy of the data defined in LOCAL-STORAGE is allocated and initialized on each invocation of the method. The storage allocated for the data is freed when the method returns.
Data items defined in the LOCAL-STORAGE SECTION cannot specify the EXTERNAL clause.
The LOCAL-STORAGE SECTION must begin with the header LOCAL-STORAGE SECTION, followed by a separator period.
You can specify the LOCAL-STORAGE SECTION in recursive programs, in nonrecursive programs, and in methods.
Method LOCAL-STORAGE content is the same as program LOCAL-STORAGE content except that the GLOBAL clause has no effect (because methods cannot be nested).