COBOL Interview Questions and Answers

Last updated on Feb 06, 2023
  • Share
COBOL Interview Questions

COBOL, an acronym for Common Business Oriented Language is an English-like computer programming language compiled and designed primarily for business use. Read more about COBOL and get a job in this field, by going through the COBOL interview questions below carefully.

The COBOL language is still being used in applications that are deployed on mainframe computers, like large-scale batch and transaction processing jobs. Being imperative, procedural and object-oriented, COBOL is mainly used by businesses, finance organizations, and administrative systems for enterprises as well as governments.

If you feel that there is a lot of content that you cannot read all at once, then, you can download all the COBOL interview questions as a PDF which shall enable you to get over these questions and answers offline as well.

Most Frequently Asked COBOL Interview Questions

Here in this article, we will be listing frequently asked COBOL Interview Questions and Answers with the belief that they will be helpful for you to gain higher marks. Also, to let you know that this article has been written under the guidance of industry professionals and covered all the current competencies.

Q1. What are the different data types in COBOL?
Answer

In general, there are five different data types in COBOL, they are:

  • Alphabetic
  • Numeric
  • Alpha-numeric
  • Sign
  • Assumed Decimal Point
Q2. How to define and access an array in COBOL?
Answer

COBOL uses the Occures clause to define and access an array/table. To access an array/table in COBOL we can use the INDEX or SUBSCRIPT and access all the elements within it as well.

Q3. What is the difference between index and subscript in COBOL?
Answer
Subscript Index
Means the number of occurrences of an array This means the number of displacement positions of an array.
Always declared in the working-storage section. It need not be declared inside the working-storage section.
It is initialized by the MOVE statement It is initialized by the SET operator.
It is comparatively slow to access It is faster than Subscript
Value is incremented using the ADD operator. Here, the value is incremented using the MOVE operator
Not necessary to declare INDEXED BY clauses. Necessary to declare INDEXED BY and any other clauses in Index.
Q4. What is static and dynamic linking in COBOL?
Answer
Static Linking Dynamic Linking
Here, all the library modules are basically copied into a final executable image. This refers to the names of external or shared libraries that are placed on the memory.
The OS places a single file on the memory containing the source code and other referencing libraries. This lets programmers use a single copy of the executable file once the program has been loaded, but not the original file, a copy of it.
Q5. How to find a calling program in COBOL?
Answer
Q6. What is the difference between binary search and sequential search in COBOL?
Answer
Binary Search Sequential Search
In this, table element key values should be in an ascending or descending order. In this, table element keys are not required to be in any order.
The table is “halved” or divided into two sections to search for the matching result. The table is searched from the top to bottom in a sequence until the matching result is found.
The better option for large tables, i.e. tables having more than 70 elements. The better option for small tables, i.e. tables with less than or equal to 70 elements.
SEARCH ALL syntax is used in Binary Searches SEARCH syntax is used for sequential searches.
Q7. What are the different rules to perform a search in COBOL?
Answer

While applying the SEARCH statement, users must abide by these following rules:

  • This statement can only be applied to a Table only if it has been indexed using the INDEXED BY statement.
  • The index must be initialized using the SET operator.
  • This statement cannot be used for finding multiple matches.
  • The SEARCH statement can be only used for doing a sequential or serial search of the table.
  • If the search process reaches the end of an array, automatically the end statement will be executed.
Q8. What is ssrange and nossrange in COBOL?
Answer

In COBOL, SSRANGE is basically a compiler option which is used to handle the array overflow systematically. In the COBOL programming language, SSRANGE also needs to be specified which helps to find the exact subscript out of range.


Whereas, the NOSSRANGE is used in COBOL for very sensitive performance-based applications. The NOSSRANGE is usually the default option which does not support runtime errors if by any case the index or subscript goes out of range.

Q9. What is the procedure division in COBOL?
Answer

In COBOL, the Procedure division is used for including the logic of the program efficiently. Consisting of multiple executable statements using variables that are defined in the data division, this type of division, paragraph and section names are focused to be user-defined.
In the procedure division, there must be at least one statement. The last statement used for ending the execution is either STOP RUN or EXIT PROGRAM.
Here’s an example to demonstrate the procedure division:
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.
DATA DIVISION.
   WORKING-STORAGE SECTION.
   01 WS-NAME PIC A(30).
   01 WS-ID PIC 9(5) VALUE '12345'.
PROCEDURE DIVISION.
   A000-FIRST-PARA.
   DISPLAY 'Hello There'.
   MOVE 'Ankit Satpathy' TO WS-NAME.
   DISPLAY "Here is my name : "WS-NAME.
   DISPLAY "Here's my ID : "WS-ID.
STOP RUN.

Q10. What is the difference between external and global variables in COBOL?
Answer
Global Variable External Variable
It is a type of variable which is available throughout the program. Also available throughout the program, it is declared but not allocated any memory space.
It is applicable only when sharing data among nested programs via the ANSI85 dialect. It is used to access globally declared data, including data declared using EXTERNAL or by other COBOL programs.
This specifies that a data-name is available for every program being contained within the program that declares it. Here, any external data item can be referenced via any program inside the run unit describing the data item.
Reviewed and verified by Best Interview Question
Best Interview Question

With our 10+ experience in PHP, MySQL, React, Python & more our technical consulting firm has received the privilege of working with top projects, 100 and still counting. Our team of 25+ is skilled in...