section12 - creating in the File-Control Paragraph, as we...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Business Oriented Programming February 15, 2005 Course 92-252-01 – Spring 2005 Creating Files. We will try this in class today together as we talk about what is required by COBOL. #1) As you already know from “reading a sequential file” COBOL Programs using files must list information in the File-Control Paragraph. In FILE-CONTROL we tell COBOL where to find our data file. We link the file name within our operating system to the file name within the program code. We need to include information for the file we are creating in the File-Control Paragraph, as we
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
did when we were reading a file. ----------------------------------------------------------- #2 As you already know from “reading a sequential file” In DATA DIVISION, we have to describe the layout of the file. We use the same PROGRAM- FILENAME from above. This links the environment section to the layout of the file. We also need to tell the program the various fields that are contained on each record in the file. We need to include information for the file we are
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: creating in the File-Control Paragraph, as we did when we were reading a file. -----------------------------------------------------------#3 As you already know from reading a sequential file We need to open the file before we can read any records. ex: OPEN INPUT PGMFILENAME. OPEN OUTPUT PGMFILENAME. The form of the Open statement tells COBOL how we are using the file.-----------------------------------------------------------#4 As you already know We need to load the buffer with data values . COBOL only does what we tell it to do. Use MOVE Statements to place data into the fields of your output file.-----------------------------------------------------------#5 As you already know from reading a sequential file We need to CLOSE the file after the program is done or SOME operating systems will not let us use the file. We include a close statement for all files in a program. ex: CLOSE PGMFILENAME....
View Full Document

This note was uploaded on 11/10/2009 for the course CIS 252 taught by Professor Unknown during the Spring '05 term at Bloomsburg.

Page1 / 4

section12 - creating in the File-Control Paragraph, as we...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online