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 MOVE Verb: The aim of this section is to introduce the learner how to move data from one place to the other place in the memory. This is completed with the help

Currency Sign - edit characters for numeric data: $ (Currency Sign): The single currency sign can appear at the leftmost place of a picture. In that situation the $ cha

We have input file, record layout is EMP ID (6 char) , EMP NAME (20 char), Designation (3 char),Salary (5 digit) Base Branch (10char) Grade (3 Alphanumeric). This is the input f

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

Numeric -   Literals : The numeric literal can be created with the help of digits only. It can have a sign (+ or -) and can also have a decimal point. If no sign is specifi

PROGRAM FOR INDEXED SEQUENTIAL FILE CREATION (RANDOM MODE): We have to write a program to create an Indexed Sequential File in random mode for Student particulars. Suppose jus

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.

B (Blank Insertion) : The occurrence of a B anyplace in the picture will insert a space character in the edited data. There can be more than one B in the picture. Examples:

Illustration of indexed tables: Index items defined through the INDEXED phrase of the OCCURS clause are one type of indexes. There can be other type of index items that are de

Minus sign - edit characters for numeric data: The minus sign can appear either at the leftmost or rightmost location of the picture. If an item is negative, a minus sign will