Close statement, COBOL Programming

CLOSE STATEMENT:

When the processing of a file is completed, then the file may be closed. This is completed with the help of the CLOSE-verb. The form of the CLOSE statement is as shown below:

            CLOSE     file-name-1       [,   file-name-2]               ...

The file should be open when a close statement can be executed. And once a file is closed, it is no longer accessible to the program. It must be opened again if the file is needed consequently.  It may be noted that dissimilar the OPEN statement, the nature of the use of the input & output file must not be mentioned in the CLOSE statement.

Illustration:

CLOSE OLD-MASTER, TRANSACTION, NEW-MASTER, PRINT-FILE.

This statement will close all the 4 files - TRANSACTION, OLD-MASTER, PRINT-FILE  and the NEW MASTER.

 

Posted Date: 10/16/2012 5:39:42 AM | Location : United States







Related Discussions:- Close statement, Assignment Help, Ask Question on Close statement, Get Answer, Expert's Help, Close statement Discussions

Write discussion on Close statement
Your posts are moderated
Related Questions
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

Rules for Simple sort verb: The work file is to be defined by a sort elaboration entry (SD entry).The format of SD entry is as shown below. The rules below should be taken

ADD VERB: The ADD Verb can be used to find the sum of two or more numbers and to store the sum.  The ADD verb takes any one of the two forms as shown below:

The LENDER Bank offers mortgages on homes valued up to $500,000. The required down payment is calculated as follows: 4% of the first $60,000 borrowed 8% of the next $30,000 borro

Rules of read statements: The next record is identified according to the rules as shown below: (i) Whenever the READ NEXT statement is the initial statement to be executed

Group Item as Operand in the Relational Condition: Whenever an operand of a relational condition is the group item, the item is then considered to be an alphanumeric field. Th

PROGRAM FOR ADD VERB: We have to write a simple program to elaborate the ADD verb. You can also use edit characters in the program. Identification division. Program- id.

77 level used for- It is Elementary level item. it Cannot be subdivisions of other items or cannot be qualified, or they can be subdivided themselves.

Display control verbs in Cobol

DATA RECORD CLAUSE: The DATA RECORD clause, documents the record names defined for the file. For illustration, DATA RECORDS ARE REC-1, REC-2, REC-3 that means there are 3diffe