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.

vThe terms file in <strong>COBOL</strong> terminology and data set or HFS file in operating-systemterminology have essentially the same meaning and are used interchangeably inthis in<strong>for</strong>mation.For Customer In<strong>for</strong>mation Control System (CICS) and online In<strong>for</strong>mationManagement System (IMS ) message processing programs (MPP), code only theENVIRONMENT DIVISION header and, optionally, the CONFIGURATION SECTION. CICSdoes not allow <strong>COBOL</strong> definition of files. IMS allows <strong>COBOL</strong> definition of filesonly <strong>for</strong> batch programs.Provide in<strong>for</strong>mation to control efficient transmission of the data records betweenyour program and the external medium.“Example: FILE-CONTROL entries”RELATED TASKS“Specifying the collating sequence” on page 9“Defining symbolic characters” on page 10“Defining a user-defined class” on page 10“Defining files to the operating system” on page 10RELATED REFERENCESSections and paragraphs (<strong>Enterprise</strong> <strong>COBOL</strong> Language Reference)Example: FILE-CONTROL entriesThe following table shows example FILE-CONTROL entries <strong>for</strong> a QSAM sequentialfile, a VSAM indexed file, and a line-sequential file.Table 1. FILE-CONTROL entriesQSAM file VSAM file Line-sequential fileSELECT PRINTFILE 1ASSIGN TO UPDPRINT 2ORGANIZATION IS SEQUENTIAL 3ACCESS IS SEQUENTIAL. 4 SELECT COMMUTER-FILE 1ASSIGN TO COMMUTER 2ORGANIZATION IS INDEXED 3ACCESS IS RANDOM 4SELECT PRINTFILE 1ASSIGN TO UPDPRINT 2ORGANIZATION IS LINE SEQUENTIAL 3ACCESS IS SEQUENTIAL. 4RECORD KEY IS COMMUTER-KEY 5FILE STATUS IS 5COMMUTER-FILE-STATUSCOMMUTER-VSAM-STATUS.1. The SELECT clause chooses a file in the <strong>COBOL</strong> program to be associated with an external data set.2. The ASSIGN clause associates the program’s name <strong>for</strong> the file with the external name <strong>for</strong> the actual data file. Youcan define the external name with a DD statement or an environment variable.3. The ORGANIZATION clause describes the file’s organization. For QSAM files, the ORGANIZATION clause is optional.4. The ACCESS MODE clause defines the manner in which the records are made available <strong>for</strong> processing: sequential,random, or dynamic. For QSAM and line-sequential files, the ACCESS MODE clause is optional. These files alwayshave sequential organization.5. For VSAM files, you might have additional statements in the FILE-CONTROL paragraph depending on the type ofVSAM file you use.RELATED TASKSChapter 9, “Processing QSAM files,” on page 151Chapter 10, “Processing VSAM files,” on page 179Chapter 11, “Processing line-sequential files,” on page 207“Describing the computing environment” on page 78 <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!