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
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.

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)

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

PICTURE specification: The size of a group item is equivalent to the total of the sizes of all the subordinate elementary items. The group item class is alphanumeric. The i

BLOCK CONTAINS CLAUSE: Integer -1 of the BLOCK CONTAINS clause indicates the block size either in terms of records or in terms of characters. For illustration, BLOCK CONTAINS

Configuration Section: This section holds an overall specification of the computer used for the purpose of the compilation and execution of the program. There are in all 3 par

Occurs Clause: Let us establish tables with the help of an illustration. Assume that there are ten different types of income-tax rates that are read from some input medium and

Object-Computer - Configuration section: The computer name specifies a specific computer on which the object program is to be executed. The MEMORY SIZE is used to show the

File- Section &Working-Storage Section: a) FILE SECTION: The FILE SECTION includes the explanation of all data items that must be read from or written onto some external

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