File-control - input-output section, COBOL Programming

Assignment Help:

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.  

 


Related Discussions:- File-control - input-output section

Restrictions - procedure in statement, There are some restrictions when the...

There are some restrictions when these procedures are used. (i) The Procedure should not contain any SORT/MERGE statement. (ii) An explicit transfer of the control outside

Write statement - indexed files, WRITE STATEMENT: The records are wri...

WRITE STATEMENT: The records are written to be logical place as determined from the value of the record key. The INVALID KEY condition occurs in the cases shown below: (i)

Updating of the relative and indexed files, UPDATING OF THE RELATIVE AND IN...

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

Use of evaluate statement, Evaluate is like a case statement & Evaluate  s...

Evaluate is like a case statement & Evaluate  stamenet can be used to replace nested Ifs. The difference b/w EVALUATE and case is that there is no 'break' is required for EVALUATE

Credit and debit sign - edit characters for numeric data, CR and DB (Credit...

CR and DB (Credit and Debit Sign): The two characters that is CR or DB symbol may appear only at the rightmost place of the picture. They are similar to the minus sign edit ch

Procedure division statements for the indexed files, PROCEDURE DIVISION sta...

PROCEDURE DIVISION statements for the indexed files: All the statements which are available for a relative file are also available for an indexed file. READ STTATEMENT :

Illustration of renames clause, Illustration of Renames clause: In the...

Illustration of Renames clause: In the illustration, PAT-OTHER-THAN-BASIC will become a fresh group consisting of DEARNESS-ALLOWANCE, HOUSE-RENT & MTHLY-INCENTIVE. Keep in min

Occurs clause - program, OCCURS CLAUSE - PROGRAM: We have to write a p...

OCCURS CLAUSE - PROGRAM: We have to write a program to demonstrate the occurs clause. Get names of the students and show them on the screen.  identification division.

Illustration of subtract verb, Illustration of Subtract verb: (a) SUBT...

Illustration of Subtract verb: (a) SUBTRACT A FROM B. This illustration means that the value of A will be subtracted from the value of B and the subtracted result will be s

Concept of a two-dimensional table, Concept of a two-dimensional table: ...

Concept of a two-dimensional table: Concept of a two-dimensional table can be easily extended to tables having three or more dimensions. The Handling of tables up to three dim

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd