File Handling in COBOL

     1.     How do you reference the following file formats from COBOL programs:
Fixed Block File  - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0 .
Fixed Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING   MODE IS F, do not use BLOCK CONTAINS
Variable Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, BLOCK CONTAINS 0. Do not code the 4 bytes for record length in FD i.e. JCL REC length will be max rec. length in pgm + 4
Variable Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, do not use BLOCK CONTAINS. Do not code 4 bytes for record length in FD i.e. JCL rec length will be max rec length in pgm + 4.
ESDS VSAM file - Use ORGANISATION IS SEQUENTIAL.
KSDS VSAM file - Use ORGANISATION IS INDEXED, RECORD KEY IS, ALTERNATE RECORD KEY IS
RRDS File - Use ORGANISATION IS RELATIVE, RELATIVE KEY IS
Printer File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0. (Use RECFM=FBA in JCL DCB).
     2.     What are different file OPEN modes available in COBOL?
INPUT,
OUTPUT,
I-O,
EXTEND.
     3.     What is the mode in which you will OPEN a file for writing? -
OUTPUT, EXTEND
     4.     In the JCL, how do you define the files referred to in a subroutine ?
Supply the DD cards just as you would for files referred to in the main program.
     5.     Can you REWRITE a record in an ESDS file?  Can you DELETE a record from it?
Can rewrite(record length must be same), but not delete.
     6.     What is file status 92? -
Logic error. e.g., a file is opened for input and an attempt is made to write to it.
     7.     What is file status 39 ?
Mismatch in LRECL or BLOCKSIZE or RECFM between your COBOL pgm & the JCL (or the Dataset label). You will get file status 39 on an OPEN.

2 comments:

Sqiar BI said...

Business intelligence Analyst
SQIAR (http://www.sqiar.com/services/bi-strategy/) is a leading Business Intelligence company.Sqiar Provide business intelligence Services Which help the company to present Information in Meaningful form.

Prologic Corporation said...

This is a good article & good site.Thank you for sharing this article. It is help us following categorize:
healthcare, e commerce, programming, it consulting, retail, manufacturing, CRM, digital supply chain management, Delivering high-quality service for your business applications,
Solutions for all Industries,
Getting your applications talking is the key to better business processes,
Rapid web services solutions for real business problems,
Web-based Corporate Document Management System,
Outsourcing Solution,
Financial and Operations Business Intelligence Solution,

prologic-corp

Computers TopOfBlogs Technology Blogs Mainframe interview question and answers,mainframe jobs,cobol,vsam,jcl,cics,db2,rdbms,mvs,tso,ispf,ibm,hcl,tcs,cts,wibro Blog Directory