What happens when you open an empty VSAM file

vsam interview questions

Moderator: Moderator Group

Post Reply
User avatar
Krishna
Site Admin
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

What happens when you open an empty VSAM file

Post by Krishna » Sun Jul 19, 2009 8:37 pm

What happens when you open an empty VSAM file in a COBOL program for input?

User avatar
Krishna
Site Admin
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

Post by Krishna » Sun Jul 19, 2009 8:37 pm

A VSAM file that has never contained a record is treated as unavailable. Attempting to open for input will fail. An empty file can be opened for output only. When you open for output, COBOL will write a dummy record to the file & then delete it out.

Post Reply

FREE TUTORIALS

Tutorials
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.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others