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
Examples - Edit characters for numeric data: The following illustration illustrates the use of Z editing characters. The character b is used to indicate the space character an

File Activity: The file activity is a measure of the proportion of records processed during an update run. Therefore we define the activity ration as shown below. Activi

Illustration of Search verb: To illustrate the other use of SEARCH verb, assume we wish to search the similar tab to find the number of persons whose deposited amount is more

CONDITION - COBOL Programming: The condition is an entity which at one point of time can have only one of the two values - true or false. As we already know that, the IF verb

MULTIPLY VERB:   The Multiply Verb causes one or more multiplicands to be multiplied by the multiplier and to store the products. The form of the MULTIPLY verb is as shown be

UPDATING OF THE RELATIVE AND INDEXED FILES: The Sequential files are updated by creating a new master file from an existing old master file and a transaction file. Such an Upda

ACCEPT STATEMENT: The ACCEPT statement is used to read the low-volume data from the operator's console, several other hardware device or from the operating system. The common

Illustration of Multiply verb: (a)  MULTIPLY A BY B. In this situation the value of A & B will be multiplied and the product will be stored in B.  The decimal point locatio

what does it used

Example of constructing an arithmetic expression: An arithmetic expression may be proceeded by a + or - sign. These operations are known as unary + or unary - operators. Il