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.

ecord in more detail. Use the READ INTO statement to bring the records intoWORKING-STORAGE. Processing occurs on the copy of data in WORKING-STORAGE.A WRITE FROM statement writes processed data into the record area defined inthe FILE SECTION.– The record-name established is the object of WRITE and REWRITE statements.– For QSAM files only, you can set the record <strong>for</strong>mat in the RECORDING MODEclause. If you omit the RECORDING MODE clause, the compiler determines therecord <strong>for</strong>mat based on the RECORD clause and on the level-01 recorddescriptions.– For QSAM files, you can set a blocking factor <strong>for</strong> the file in the BLOCKCONTAINS clause. If you omit the BLOCK CONTAINS clause, the file defaults tounblocked. However, you can override this with z/<strong>OS</strong> data managementfacilities (including a DD file job-control statement).– For line-sequential files, you can set a blocking factor <strong>for</strong> the file in the BLOCKCONTAINS clause. When you code BLOCK CONTAINS 1 RECORDS, orBLOCKCONTAINS n CHARACTERS, where n is the length of one logical record in bytes,WRITE statements result in the record being transferred immediately to the filerather than being buffered. This technique is useful when you want eachrecord written immediately, such as to an error log.Programs in the same run unit can share, or have access to, common files. Themethod <strong>for</strong> doing this depends on whether the programs are part of a nested(contained) structure or are separately compiled (including programs compiled aspart of a batch sequence).You can use the EXTERNAL clause <strong>for</strong> separately compiled programs. A file that isdefined as EXTERNAL can be referenced by any program in the run unit thatdescribes the file.You can use the GLOBAL clause <strong>for</strong> programs in a nested, or contained, structure. Ifa program contains another program (directly or indirectly), both programs canaccess a common file by referencing a GLOBAL file-name.RELATED CONCEPTS“Nested programs” on page 458RELATED TASKS“Sharing files between programs (external files)” on page 475RELATED REFERENCES“FILE SECTION entries”FILE SECTION entriesThe entries that you can use in the FILE SECTION are summarized in the tablebelow.Table 2. FILE SECTION entriesClause To define NotesFDThe file-name to bereferred to in PROCEDUREDIVISION input-outputstatements (OPEN, CL<strong>OS</strong>E,READ, also START andDELETE <strong>for</strong> VSAM)Must match file-name in the SELECT clause.file-name is associated with a ddnamethrough the assignment-name.14 <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!