Hi plz help me out

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply

Hi plz help me out

Post by Guest » Fri May 12, 2006 10:05 am

1.I have a file and have opened that file to write some records, and I have written records into that file but finally I have forget to close the file. Now what will happen to the file and the program.


Posts: 2
Joined: Fri May 12, 2006 12:40 pm

Post by krvarada » Fri May 12, 2006 12:47 pm

As long as u r not opening the file again in the same pgm, nothing is going to happen. When the trasaction or the job completes all the resources used by it would be released.

User avatar
Active Member
Posts: 144
Joined: Fri Feb 24, 2006 11:33 am

Post by arrbee » Mon May 15, 2006 7:01 am

Probably you should've tried a small program yourself and see what happens..........:-)

It certainly closes it. Surprisingly, you won't get any warnings in the compilation also !!

Arr Bee
?My joy in learning is partly that it enables me to teach? - Seneca(Roman philosopher, mid-1st century AD)

Shashank Gite
Posts: 4
Joined: Tue Feb 24, 2009 3:54 pm
Location: Pune

Post by Shashank Gite » Tue Jun 16, 2009 5:15 pm


I don't think it will work, it will definetly give error "File not closed" during run time.
Shashank Gite

User avatar
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Tue Jun 16, 2009 5:58 pm

Shashank Gite wrote:it will definetly give error "File not closed" during run time.
why do you think that? Neither COBOL, nor LE, returns such messages.

please do a little research before providing answers to posts.


As arrbee suggested in his post:
such elementary questions can be answered by a small test program,
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Posts: 10
Joined: Sun Jul 04, 2010 5:26 pm

Post by anilsani285 » Wed Jul 07, 2010 8:18 am

Cobol 74 compile needs the file to be closed and in cobol 85 their no need of closing the file manually the file be closed when the job ends


if it is vsam file then u need to close it so that u can avoid file status code 97 for processing the same file for the next time...


Topic deleted by Admin

Post by academyindia4 » Wed Jan 27, 2016 8:31 pm

<< Content deleted By Admin >>


Topic deleted by Admin

Post by academyindia4 » Mon Feb 01, 2016 10:14 pm

<< Content deleted By Admin >>

Post Reply


Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Mainframe Interview questions

Other References
Mainframe Tools and others