10.07.2015 Views

Enterprise COBOL for z/OS V4.2 Programming Guide

Enterprise COBOL for z/OS V4.2 Programming Guide

Enterprise COBOL for z/OS V4.2 Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Table 2. FILE SECTION entries (continued)Clause To define NotesCODE-SET ASCII or EBCDIC files QSAM only.When an ASCII file is identified with theCODE-SET clause, the corresponding DDstatement might need to haveDCB=(OPTCD=Q. . .) or DCB=(RECFM=D. . .)coded if the file was not created using VS<strong>COBOL</strong> II, <strong>COBOL</strong> <strong>for</strong> <strong>OS</strong>/390 ® &VM,orIBM <strong>Enterprise</strong> <strong>COBOL</strong> <strong>for</strong> z/<strong>OS</strong>.RECORDING MODEPhysical recorddescriptionQSAM onlyRELATED CONCEPTS“Labels <strong>for</strong> QSAM files” on page 174RELATED REFERENCESFile section (<strong>Enterprise</strong> <strong>COBOL</strong> Language Reference)Comparison of WORKING-STORAGE and LOCAL-STORAGEHow data items are allocated and initialized varies depending on whether theitems are in the WORKING-STORAGE SECTION or LOCAL-STORAGE SECTION.WORKING-STORAGE <strong>for</strong> programs is allocated at the start of the run unit.Any data items that have VALUE clauses are initialized to the appropriate value atthat time. For the duration of the run unit, WORKING-STORAGE items persist in theirlast-used state. Exceptions are:v A program with INITIAL specified in the PROGRAM-ID paragraphIn this case, WORKING-STORAGE data items are reinitialized each time that theprogram is entered.v A subprogram that is dynamically called and then canceledIn this case, WORKING-STORAGE data items are reinitialized on the first reentry intothe program following the CANCEL.WORKING-STORAGE is deallocated at the termination of the run unit.See the related tasks <strong>for</strong> in<strong>for</strong>mation about WORKING-STORAGE in <strong>COBOL</strong> classdefinitions.A separate copy of LOCAL-STORAGE data is allocated <strong>for</strong> each call of a program orinvocation of a method, and is freed on return from the program or method. If youspecify a VALUE clause <strong>for</strong> a LOCAL-STORAGE item, the item is initialized to that valueon each call or invocation. If a VALUE clause is not specified, the initial value of theitem is undefined.Threading: Each invocation of a program that runs simultaneously on multiplethreads shares access to a single copy of WORKING-STORAGE data. Each invocationhas a separate copy of LOCAL-STORAGE data.“Example: storage sections” on page 1716 <strong>Enterprise</strong> <strong>COBOL</strong> <strong>for</strong> z/<strong>OS</strong> <strong>V4.2</strong> <strong>Programming</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!