YouTube Icon

Interview Questions.

Cobol Interview Questions and Answers - Jul 16, 2022

fluid

Cobol Interview Questions and Answers

Q1. What is COBOL?

 

Ans: COBOL is abbreviated as Common Business Oriented Language and it is one of the oldest programming languages. It in the main used for commercial enterprise, finance and administrative systems for businesses.

 

Q2. Which division and paragraphs are obligatory for a COBOL software?

 

Ans: Identification division and Program ID are mandatory for a COBOL software.

 

Q3. How do you specify and use a cursor in a COBOL software?

Ans: Use DECLARE CURSOR announcement both in running storage or in process department ( earlier than open cursor), to specify the SELECT statement. Then use OPEN, FETCH rows in a loop and subsequently CLOSE.

Q4. What is a synonym?

Ans: A synonym is an unqualified opportunity call for a desk or view.

Q5. What is a overseas key?

Ans: A overseas secret's the important thing defined in a single desk to reference the number one key of a reference desk. This overseas key should have the equal shape as the reference table's number one key.

Q6. What is referential integrity?

Ans: Referential integrity is the automated enforcement of referential constrains that exist among a reference desk and a referencing desk. When referential integrity is enforced, the cost of a overseas key exists as a number one key cost inside the reference desk. In other words, whilst referential integrity is enforced, all of the foreign key values in, as an instance, the "department code" column in an "employee" desk exist as primary key values in a "department" talbe.

Q7. How do you outline a table/array in COBOL?

Ans: ARRAYS. 05 ARRAY1 PIC X(nine) OCCURS 10 TIMES. 05 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX.

 

Q8. What is difference among COBOL and VS COBOL II?

Ans: In the use of COBOL on PC we've got most effective flat files and the programs can get right of entry to most effective confined garage, while in VS COBOL II on M/F the programs can access up to 16MB or 2GB relying on the addressing and can use VSAM documents to make I/O operations quicker.

 

Q9. How do you differentiate between COBOL and COBOL-II?

Ans:

MVSXA and MVSESA guide the compiler and the object packages it produces may be run in both 24- or 31-bit addressing mode.

VMXA and VMESA help the compiler and the item programs it produces can be run in either24- or 31-bit addressing mode.

VSEESA helps the compiler and the item programs it produces may be run below VSEESA.

The following functions are available with VS COBOL II.

Q10. What is a correlation call?

 

Ans: A correlation name is a special form of column designator that connects specific columns inside the numerous tiers of a multilevel SQL question.

Q11. How to execute a set of JCL statements from a COBOL application?

Ans: Using EXEC CICS SPOOL WRITE (var-call) END-EXEC command. Var-name is a COBOL host structure containing JCL statements.

 

Q12. How do you publish JCL via a COBOL application?

 

Ans: Use a record //dd1 DD sysout=(*, intrdr)write your JCL to this document. Pl a few on do this out.

 

Q13. What is the distinction among Structured COBOL Programming and Object Oriented COBOL programming?

 

Ans: Structured programming is logical way of programming where the functionalities are divided into modules and enables write the code logically.

Object Oriented Cobol language is a Natural way of programming in which you perceive the gadgets, and then write functions and procedures around that item.

Q14. What are declaratives and what are their makes use of in cobol?

 

Ans: The declarative are used to provide special sections which can be executed in case of awesome condition occurrences. The declarative have to be grouped and coded on the start of division of manner. Also the entire procedure must be break up into sections. A organization of declarative usually begin with DECLARATIVES and quit by using END DECLARATIVES in area A.

There are 3 sorts of declaratives utilized in COBOL:

Exception: They are used for errors that arise in a file coping with procedure.

Debugging: As their call suggests, used for debugging strains with “D” code in w-s section.

Label: they're used to signify a starting.

Q15. What is the difference among performing a SECTION and a PARAGRAPH?

 

Ans: SECTION will have all of the paragraphs that are a part of the section, to be finished.

PARAGRAPH may have simplest that paragraph to be achieved.

 

Q16. What happens while you say OPEN CURSOR?

Ans: If there's an ORDER BY clause, rows are fetched, taken care of and made available for the FETCH assertion. Other wise in reality the cursor is placed on the primary row.

Q17. What is the distinction among SEARCH and SEARCH ALL? What is extra efficient?

Ans: SEARCH is a sequential search from the start of the desk. SEARCH ALL is a binary seek, constantly dividing the table in two halves until a fit is discovered. SEARCH ALL is extra green for tables larger than 70 objects.

Q18. What recommendations must be followed to write down a established COBOL prgm?

Ans:

Use ‘examine’ stmt for building cases.

Use scope terminators for nesting.

Use in line performs stmt for writing ‘do ‘structures.

Use test earlier than and test after in the perform stmt for writing do-even as constructions.

Q19. What is the distinction between a binary seek and a sequential search? What are the pertinent COBOL instructions?

Ans:

In a binary search the desk detail key values must be in ascending or descending sequence.

The table is ‘halved’ to look for equal to, extra than or much less than situations until the element is located.

In a sequential search the desk is searched from pinnacle to bottom, so (mockingly) the factors do no longer ought to be in a particular collection.

The binary search is tons faster for large tables, at the same time as sequential works nicely with smaller ones.

SEARCH ALL is used for binary searches; SEARCH for sequential.

Q20. What is LENGTH in COBOL II?

Ans: LENGTH acts like a special register to inform the length of a collection or elementary object.




CFG