File-control - input-output section, COBOL Programming

FILE-CONTROL:

The FILE-CONTROL paragraph names each and every file and identifies the first medium through file control entries. The basic format of a file control entry is given below:

  SELECT   [OPTIONAL]   file-name   ASSIGN   TO hardware-name.

In common, a COBOL source program uses some files. For each of these files, there should be a FILE-CONTROL entry. This entry names the file and assigns the peripheral device that holds that specific file. The file names which appear in the SELECT clauses should be exclusive and all these files should be described in DATA DIVISION. The file name must be formed according to the rules of data names.

The word OPTIONAL may be used only for the input files. Whenever the object program is executed, the optional files do not require being present on every juncture. If the optional clause is omitted for a specific file, the file should be present during the execution of the program. If the file is missing or absent, an execution error will occur. On the other hand, if an elective file is absent, any try to open the file for reading will not result in an error. But the absent file will be measured to be an empty file that means that the file does not contain any record.  

 

Posted Date: 10/16/2012 3:42:30 AM | Location : United States







Related Discussions:- File-control - input-output section, Assignment Help, Ask Question on File-control - input-output section, Get Answer, Expert's Help, File-control - input-output section Discussions

Write discussion on File-control - input-output section
Your posts are moderated
Related Questions
Introduction to COBOL: In the year 1959, a new language named the COBOL ( CO mmon B usiness O riented L anguage) was introduced remembering the business purpose application

PROGRAM TO FIND INTEREST ON BANK DEPOSITS: We have to write a program to find interest on deposits. The criteria is given below : identification division. program-

READ STATEMENT: The aim of this verb is to make available the next logical record from the input file. It is important to note the meaning of the "next" logical record in the

RELATIVE FILES: The Files that are stored on a direct access storage medium like magnetic disk are frequently known as direct access files. The COBOL supports three different

Example of Open statement: Illustration: The OPEN INPUT TRANSACTION, OLD-MASTER OUTPUT NEW-MASTER. The illustration represents that there are two input files named the

PROGRAM FOR SIMPLE PERFORM: We have to write a program to elaborate simple PERFORM statement Identification division. Program- id.  Perf1. Environment division. Da

FILE UPDATION: The method of modifying an old file with present information is termed as file updating. Master file: A master file is a file which is used as an author

Sign - Picture clause: The numeric data item can be signed or unsigned. If a numeric data is regarded as unsigned then during the execution these unsigned data items are treat

PERFORM WITH UNTIL OPTION: The format is as shown below: Illustration:  A) Perform p-3 until i > 5. Here p-3 will be executed whenever i B)  Perform p-2 thru

PROGRAM FOR SIZE ERROR:   We have to write an easy program to elaborate the size error option. Identification division. Program- id. sizeerr. Environment division.