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
ARITHMETIC VERBS: Most of the problems need some computations to be performed on the input or intermediate data that are numeric in nature. The Arithmetic verbs are used to pe

SIMPLE MERGE VERB: Like sorting, the merging of files is often required in different commercial application. It is likely to merge two or more files with the help of one MERGE

RESERVE clause: This clause indicates the number of buffers to be used for the file. Integer-1 specifies this number. ORGANIZATION/ACCESS clause: These two clause

There are some restrictions when these procedures are used. (i) The Procedure should not contain any SORT/MERGE statement. (ii) An explicit transfer of the control outside

calculate simple interest

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,

PROGRAM FOR IF -ELSE: We have to write a program to check whether the given number is ODD or EVEN. You can use IF..ELSE. Identification division. Program- id. IfElse.

When using the accept verb in cobol is it possible to assign something other then "SYSIN" for a ddname?

LABEL RECORD CLAUSE: This clause specifies whether or not the standard header and trailer labels must be present in the magnetic-tape files. VALUE OF CLAUSE: The VAL

File Description for the Relative and Indexed Files: The FD entry for a relative or an indexed file is similar to that of a sequential file. Some compilers do not permit varia