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
Abbreviation: The Consecutive relational conditions in a compound condition can be abbreviated in many cases as shown: (i) When the subjects in the consecutive relational c

Write a COBOL IF sentence to use the values of numeric variables EXAM and COURSEWORK , both assumed to be with format PIC 999 and in the range 0 to 100 and to move the value:

Major difference between file and array how does record read from array and file why we are not preparing array for real time

Data Division: The Data Division is a part of the COBOL program where every data item processed by the program is described. It is very important to note that unless a data

ROUNDED OPTION: Let us consider the DATA DIVISION entries which are as shown below: Now, subsequent to the execution of the statement ADD A B GIVING C, the C will hold

WRITE Statement:      The WRITE statement for a relative file has the format which is as shown below.          WRITE  record-name   [ FORM   identifier ]

I uploaded a file from PC to Mainframe, variable LRCL 256. In my COBOL program I defined it as FD INPUT-FILE LABEL RECORDS ARE OMITTED BLOCK CONTAINS 0 RECORDING MODE

Illustration of simple sort verb: Illustration: Suppose that we have a card file with the following records description in the data division. The names of the work fil

SEQUENTIAL FILES:   The purpose of the proposed section is to introduce the concepts such as File characteristics, File Description for Fixed-Length Records, File-Control

How do i write a simple cobol programming that works