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
PROCEDURE DIVISION statements for the relative files: The statements OPEN, CLOSE, READ, WRITE and REWRITE that are available for sequential files are also available for the re

Column and Field in COBOL program: In COBOL there are 2 types of entries termed as margin A and margin B entries. The Margin A entries start from the column 8, 9, 10 or 11 and

Common form of the READ statements: Format 1 is the common form of the READ statements. Format 2 is used when the access mode is either random or dynamic. For illustration,

Example of Special-names: Consider the illustration: Let the SPECIAL-NAMES paragraph be as shown: SPECIAL-NAMES. CHANNEL 1 IS PAGE-TOP. The Channel is related with the t

.(Period or Decimal Point) : The period may be used to insert a decimal point and may not come into view more than once. Both the period and V cannot appear in similar picture

INPUT-OUTPUT SECTION: This section holds information regarding the files to be used in the program. There are 2 paragraphs in this section- FILE-CONTROL & I-O-CONTROL. The

RULES OF REDEFINES CLAUSE The rules shown below govern the use of the REDEFINES clause: (i) The level-number of data-name-1 and data-name-2 should be identical. (ii) Exce

Illustration of if- else statement: IF OK-BALANCE NEXT SENTENCE ELSE MOVE 2 BALANCE-CODE In this illustration, the OK-BALANCE is a condition name. No action is specific if

NONSTANDARD CLAUSES: The various clauses explained above are as per the ANSI standard. Also, most compilers provide for additional nonstandard clauses to meet the specific nec

WRITE STATEMENT: The WRITE Statement verb releases a record in an output file. The syntax for the WRITE statement can be unlike depending on the output device and the medium us