Below, frequently asked Top COBOL Interview Questions and Answers for freshers and experienced.
 COBOL, which stands for Common Business Oriented Language, is one of the oldest high-level programming languages still in use today. It was designed specifically for business, finance, and administrative systems in large organizations. COBOL is known for its readability, English-like syntax, and ability to handle massive amounts of data processing. It is widely used in industries where legacy systems and mainframe computers are prevalent, such as banking, insurance, and government sectors. COBOL programs are used to develop application software that handles complex business operations and transactions.
Elementary level item. Cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves.
For condition name entry
For Renames clause items
PIC 9.99 is a four-position field that actually contains a decimal point
The maximum value is 99999999.
 In COBOL, there are five main data types:
 In programming, a subscript and an index are terms used to access elements within an array or a collection. While they are often used interchangeably, there is a slight difference in their meaning and usage. A subscript refers to the position or occurrence of an element within an array. It is typically an integer value that represents the relative position of the element in the array. Subscripts are commonly used in languages like FORTRAN and BASIC.
 In programming, a static call and a dynamic call are two different ways of invoking or executing a subroutine or a program. Here’s the difference between them: Static Call: A static call refers to a call to a subroutine or program where the called program is a stand-alone executable program. It is typically a separate module or program unit that can be compiled and linked independently. During the compilation and linking process, the calling program is statically linked with the called program. The address or entry point of the called program is known at compile time, and the call is resolved and validated during the compilation process. Static calls are commonly used when the called program remains constant throughout the execution. Dynamic Call: A dynamic call refers to a call to a subroutine or program where the called program is not an executable program by itself. Instead, it is a program that can be dynamically loaded and executed at runtime. The address or entry point of the called program is determined during runtime, based on the conditions or parameters specified by the calling program. Dynamic calls provide flexibility in program execution as the called program can be determined and changed dynamically based on the program’s logic or user input.
 In programming languages like COBOL, the CONTINUE statement and the NEXT SENTENCE statement serve different purposes and have distinct effects on the program flow. CONTINUE Statement: The CONTINUE statement is a placeholder or null statement that has no effect on program execution. It is used when a statement is required syntactically but no specific action needs to be performed at that point in the program. The CONTINUE statement is typically used for readability or as a placeholder to be replaced with actual code in the future. It allows the program to continue execution without performing any specific operation. NEXT SENTENCE Statement: The NEXT SENTENCE statement is used to transfer control to the next executable statement following the current statement. It is often used within the conditional statements (IF, EVALUATE) to skip the remaining part of the current sentence and proceed to the next one. The NEXT SENTENCE statement effectively skips over the subsequent statements within the current sentence and continues program execution from the next executable statement.
 Structured COBOL programming and object-oriented COBOL programming are two different paradigms used in COBOL programming. Here’s the difference between them: Structured COBOL Programming: Structured programming is a logical approach to programming where the code is organized into modular and manageable units called modules or procedures. It emphasizes the use of structured control flow constructs such as sequence, selection (IF-THEN-ELSE), and iteration (PERFORM, DO) to improve program clarity, maintainability, and reusability. In structured COBOL programming, the focus is on breaking down the program into smaller, self-contained modules that perform specific tasks. Object-Oriented COBOL Programming: Object-oriented COBOL programming is a natural extension of structured programming that introduces the concept of objects and classes. It allows the programmer to define objects, which encapsulate data and the procedures or methods that operate on that data. Object-oriented COBOL programming emphasizes the concepts of inheritance, polymorphism, and encapsulation. It enables the creation of reusable and extensible code by modeling real-world entities as objects and leveraging the interactions between them.
 The LOCAL-STORAGE section in COBOL is a division within the DATA DIVISION that is used to define data items that are specific to a particular program execution. It provides a temporary storage area for variables and data that are required during the execution of a program but do not need to persist between program invocations.
Logic error. e.g., a file is opened for input and an attempt is made to write to it.
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.
In COBOL, the INPUT PROCEDURE and OUTPUT PROCEDURE are sections within the SORT verb that define the logic for processing input records and output records during a sorting operation. INPUT PROCEDURE: The INPUT PROCEDURE is responsible for handling the input records that are read from an input file. Within the INPUT PROCEDURE, you can perform tasks such as opening the input file, reading and editing the input records, and preparing the data for sorting. You have the flexibility to perform any necessary data manipulations, validations, or calculations on the input records before releasing them for sorting. Finally, the input file is closed, completing the input processing phase. OUTPUT PROCEDURE: The OUTPUT PROCEDURE is responsible for handling the output records that result from the sorting operation. Within the OUTPUT PROCEDURE, you can perform tasks such as writing the sorted records to an output file or performing further processing on the sorted data. You have the flexibility to define any additional data manipulations, formatting, or calculations on the output records as needed. Once the output records are processed, the output file is closed, completing the output processing phase.
File opening modes in COBOL include: INPUT, OUTPUT, I-O, and EXTEND.
SEARCH – is a serial search. SEARCH ALL – is a binary search & the table must be sorted (ASCENDING/DESCENDING KEY clause to be used & data loaded in this order) before using SEARCH ALL.
 Static linking and dynamic linking are two different methods of connecting or integrating subroutines or modules within a program. Here’s the difference between them: Static Linking: Static linking refers to the process of combining the called subroutine or module into the calling program at compile time or link time. In static linking, the code of the called subroutine is physically inserted into the main program, and the resulting executable file contains all the necessary code. During program execution, there is no need to locate or load external libraries or modules as everything is self-contained within the executable. Static linking provides a standalone executable file that can be run independently. Dynamic Linking: Dynamic linking, on the other hand, involves keeping the called subroutine or module separate from the main program at compile or link time. During program execution, the main program and the called subroutine exist as separate entities. The linking or connection between them occurs dynamically at runtime when the subroutine is needed. The main program references and loads the required subroutine or module from external libraries or shared libraries on-demand. Dynamic linking allows for modularity and flexibility as multiple programs can share and utilize the same external libraries.
 The EVALUATE statement is used for conditional branching and decision-making in programming languages like COBOL. It provides a structured and efficient way to perform multiple comparisons and execute corresponding actions based on the evaluated conditions. The EVALUATE statement is similar to a case statement or nested IF statements found in other programming languages. It allows the program to compare a given value or expression against multiple conditions, known as WHEN clauses, and perform specific actions associated with the matched condition.
 The REPLACING option in the COPY statement is used to modify or replace specific text within a copybook when it is included in a program. It allows for the reuse of the same copybook in multiple places within the code while making selective changes to certain portions of the copybook.
Answer: The ON SIZE ERROR option is used to handle arithmetic errors related to the size or range of numeric values in programming languages like COBOL. It primarily captures errors such as fixed-point overflow, division by zero, and certain power or exponentiation calculations. The specific errors trapped by the ON SIZE ERROR option include:
 In a COBOL program, there are certain divisions and paragraphs that are mandatory and must be included. These are:
 Global variables and external variables are two types of data variables used in COBOL programs. Here’s the difference between them: Global Variables: Global variables are data variables that are accessible and visible only within the scope of a specific program or module. They are declared and defined within the program itself and can be accessed by any subroutine, paragraph, or section within that program. Global variables are limited to the scope of the program and cannot be accessed from other programs or modules. External Variables: External variables, also known as external data items, are data variables that can be referenced from multiple programs residing in the same system library. They are declared and defined in a separate copybook or program that is shared by multiple programs. External variables allow for data sharing and communication between different programs within the same library.
 In COBOL, the PIC 9V99 notation is used to define a numeric field with a specific format and implied decimal point. Here’s what it signifies: The “PIC 9V99” notation indicates a three-position numeric field where the first position is for a whole number digit, and the following two positions represent decimal places. The “V” character is used as an implied or assumed decimal point. This format allows for the representation of decimal numbers with two decimal places.
When writing a structured COBOL program, it is important to follow certain guidelines to ensure readability, maintainability, and efficiency. Here are some guidelines to consider:
A COBOL program is typically divided into four divisions:
COMP-1 and COMP-2 are data types used in COBOL for representing floating-point numbers with different levels of precision. Here’s a more detailed explanation of each:
In COBOL, the SEARCH operation allows for searching within a table. Here are the rules associated with performing a search in COBOL:
In COBOL, the SORT operation is performed using the SORT verb. Here are the basic rules and requirements for using the SORT operation: These rules ensure that the SORT operation can be performed correctly and efficiently in a COBOL program.
The REDEFINES clause allows you to use different data description entries to describe the same computer storage area. OR The REDEFINES clause allows the same memory area to be described by different data items
When performing the REWRITE operation in COBOL, it is necessary to have the file opened in I-O mode. This is because the REWRITE operation requires reading the existing record from the file before updating it. The REWRITE operation is used to modify or update an existing record in a file without changing its position. Before performing the REWRITE, the program needs to locate the specific record within the file by performing a prior READ operation. This read operation fetches the desired record from the file and makes it available for modification.
INSPECT is used to know number of times a specific character occurs or to replace some portion of data.
 The Data Division in COBOL is divided into six sections that serve specific purposes in defining and organizing data within a program. These sections are as follows:
Cobol does not allow you to directly display COMP-3. The only way you can display it is by moving the value into a variable.
 Both the CALL statement and the LINK statement are used to invoke external programs or subroutines in COBOL. However, there is a difference in the way they are used and their relationship to COBOL. CALL Statement: The CALL statement is a COBOL verb that is used to invoke an external program or subroutine and transfer control to it. It is a standard COBOL command that allows one program to call another program or subroutine. When a CALL statement is executed, control is transferred to the called program, and after the called program completes its execution, control returns to the next statement following the CALL statement in the calling program. LINK Statement: The LINK statement, on the other hand, is not a COBOL verb but rather a facility provided by the underlying operating system or runtime environment. It is used to invoke an external program or routine, similar to the CALL statement. However, the LINK statement is typically used when interacting with programs written in other languages or when invoking system-level functions. The LINK statement transfers control to the external program, and control may or may not return to the calling program.
GOBACK returns control to the calling program STOP RUN stops the current work unit and returns control to OS EXIT PROGRAM is used to come out of a program that has been called by another program
These answers should provide you with a good understanding of the topics. However, it’s always recommended to study further and refer to COBOL language documentation for more detailed information and examples.
What do you know about COBOL?
What is 77 level used for?
What is 88 level used for?
What is 66 level used for?
What is PIC 9.99?
What is the maximum value that can be stored in S9(8) COMP?
What are the different data types in COBOL?
What is the difference between a subscript and an index in programming?
What is the difference between a static call and a dynamic call in programming?
What is the difference between the CONTINUE statement and the NEXT SENTENCE statement in programming?
What is the difference between structured COBOL programming and object-oriented COBOL programming?
What is the purpose of the LOCAL-STORAGE section in COBOL?
What is file status 92?
What is file status 39?
What is the purpose of the INPUT PROCEDURE and OUTPUT PROCEDURE in COBOL?
What are the file opening modes in COBOL?
What is the difference between SEARCH and SEARCH ALL?
What is the difference between static linking and dynamic linking in programming?
What is the purpose of the EVALUATE statement in programming?
What is the purpose of the REPLACING option in the COPY statement?
What type of error is caught by the ON SIZE ERROR option in programming?
Which divisions and paragraphs are required in a COBOL program?
What is the difference between global variables and external variables in COBOL?
What does the PIC 9V99 notation indicate in COBOL?
What are the guidelines for writing a structured COBOL program?
What are the divisions of a COBOL program?
What is the difference between COMP-1 and COMP-2 ?
Could you please provide me with information about the different rules to perform a SEARCH?
Could you please provide me with information about the different rules for the SORT operation in COBOL?
What is REDEFINES?
Why is it necessary to open a file in I-O (Input-Output) mode for the REWRITE operation in COBOL?
When is INSPECT verb is used in COBOL?
How many sections are there in the Data Division of COBOL?
How to display COMP-3 variable in Cobol?
What is the difference between a CALL statement and a LINK statement in COBOL?
What is the Difference between GOBACK, STOP RUN and EXIT PROGRAM in COBOL?
COBOL Interview Questions for Experienced Candidates
What are the different ways to handle date arithmetic in COBOL?
You can use intrinsic functions like DATE-OF-INTEGER, INTEGER-OF-DATE, and FUNCTION CURRENT-DATE to perform calculations on dates.
You can also manipulate date fields by splitting them into individual components (year, month, day) and perform arithmetic operations on these components.
Can you Explain the differences between CALL and LINK statements in COBOL?
CALL statement is used to transfer control to a subroutine or a separate COBOL program. It establishes a new level of the calling program hierarchy and returns control back to the caller upon completion.
 LINK statement is used for dynamic program linking. It transfers control to a specified program or routine and transfers control back to the calling program upon completion. It allows the called program to directly access data and variables of the calling program.
How can you handle file status codes in COBOL programs?
COBOL provides a predefined set of file status codes that indicate the status of file operations (such as OPEN, READ, WRITE, CLOSE). These codes are stored in a special 2-byte field called FILE-STATUS.
You can check the value of the FILE-STATUS field after file operations and take appropriate actions based on the returned status code. For example, you can handle errors, retry operations, or display error messages.
What is the purpose of the REDEFINES clause in COBOL, and how is it used?
The REDEFINES clause is used to define two or more data items that occupy the same storage area. It allows different interpretations or representations of the same memory location.
It is primarily used for data item overlaying, where a single memory location can be used to store different types of data depending on the program logic or processing requirements.
How do you handle decimal arithmetic in COBOL, and what are the considerations for precision and scale?
COBOL provides built-in support for decimal arithmetic through the USAGE clause. You can declare numeric fields with USAGE IS COMPUTATIONAL or COMPUTATIONAL-3 to ensure decimal arithmetic precision and rounding.
Considerations for precision and scale involve defining appropriate PIC (Picture) clauses, including the PICTURE and SCALE attributes, based on the decimal requirements of the data.
Can you explain the differences between static and dynamic linking in COBOL?
Static linking is done at compile time, where all the necessary subprograms or libraries are resolved and bound to the main program. The resulting executable contains all the required code.
Dynamic linking occurs at runtime, where the program references external subprograms or libraries. The linkage is resolved dynamically during program execution, allowing for flexibility and modularity.
What is the significance of the INITIALIZE verb in COBOL, and how is it used?
The INITIALIZE verb is used to initialize a group or elementary data item to its default initial values. It sets the value of each data item within the group to the predefined initial value defined by the USAGE clause.
How do you handle exceptions and abnormal termination in COBOL programs?
COBOL provides several error-handling techniques, including the use of condition-names, the ON EXCEPTION phrase, and the declarative section, to handle exceptions and abnormal termination.
By defining condition-names and associating them with specific exception conditions, you can handle errors or exceptional situations gracefully and take appropriate actions.
Explain the concept of file organization in COBOL, such as sequential, indexed, and relative?
Sequential file organization is used when records are accessed and processed in the order they appear in the file, from start to end.
Indexed file organization involves the use of an index to allow direct access to records based on a key value.
Relative file organization provides direct access to records using relative record numbers.
How can you handle table processing in COBOL, including search and sort operations?
– COBOL provides various table-handling capabilities like SEARCH, SEARCH ALL, SORT, and MERGE.
– SEARCH and SEARCH ALL are used to search for specific values in a table, while SORT and MERGE are used for sorting and merging table elements based on specified criteria.
What are the differences between level numbers 66 and 88 in COBOL?
Level number 66 is used for a renaming entry. It allows a data item to be renamed without allocating additional storage. It is often used to provide a more descriptive name for an existing data item.
 Level number 88 is used for condition-names. It represents a condition or a flag that can be tested for true or false. Condition-names are associated with data items and are primarily used for decision-making or branching logic.
Can you explain the purpose and usage of the INSPECT verb in COBOL?
The INSPECT verb in COBOL is used for string manipulation and data manipulation tasks. It allows you to search, replace, and modify characters or substrings within a data item.
INSPECT can be used to perform operations like counting occurrences, replacing characters, removing leading or trailing spaces, validating data formats, and more.
How can you handle sequential and indexed file processing in COBOL?
For sequential file processing, you can use the READ, WRITE, and REWRITE statements to read records sequentially from an input file or write records sequentially to an output file.
For indexed file processing, COBOL supports indexed file organizations like QSAM, VSAM, and ISAM. You can use the START, READ, WRITE, and REWRITE statements with associated file-control clauses to access and process indexed files.
What is the difference between CALL and CICS commands in COBOL programs?
CALL statement is a COBOL language construct used for program-to-program communication within a batch environment.
CICS commands, such as EXEC CICS READ or EXEC CICS WRITE, are used in COBOL programs running under the CICS (Customer Information Control System) transaction processing environment. They provide access to CICS services and resources.
Can you explain the differences between USING and GIVING phrases in COBOL programs?
The USING phrase is used in the PROCEDURE DIVISION to pass data from the calling program to the called program or subroutine.
The GIVING phrase is used to return results from the called program or subroutine to the calling program.
COBOL Interview Questions and Answers
Below, frequently asked Top COBOL Interview Questions and Answers for freshers and experienced.
What do you know about COBOL?
What is 77 level used for?
What is 88 level used for?
What is 66 level used for?
What is PIC 9.99?
What is the maximum value that can be stored in S9(8) COMP?
What are the different data types in COBOL?
What is the difference between a subscript and an index in programming?
What is the difference between a static call and a dynamic call in programming?
What is the difference between the CONTINUE statement and the NEXT SENTENCE statement in programming?
What is the difference between structured COBOL programming and object-oriented COBOL programming?
What is the purpose of the LOCAL-STORAGE section in COBOL?
What is file status 92?
What is file status 39?
What is the purpose of the INPUT PROCEDURE and OUTPUT PROCEDURE in COBOL?
What are the file opening modes in COBOL?
What is the difference between SEARCH and SEARCH ALL?
What is the difference between static linking and dynamic linking in programming?
What is the purpose of the EVALUATE statement in programming?
What is the purpose of the REPLACING option in the COPY statement?
What type of error is caught by the ON SIZE ERROR option in programming?
Which divisions and paragraphs are required in a COBOL program?
What is the difference between global variables and external variables in COBOL?
What does the PIC 9V99 notation indicate in COBOL?
What are the guidelines for writing a structured COBOL program?
What are the divisions of a COBOL program?
What is the difference between COMP-1 and COMP-2 ?
Could you please provide me with information about the different rules to perform a SEARCH?
Could you please provide me with information about the different rules for the SORT operation in COBOL?
What is REDEFINES?
Why is it necessary to open a file in I-O (Input-Output) mode for the REWRITE operation in COBOL?
When is INSPECT verb is used in COBOL?
How many sections are there in the Data Division of COBOL?
How to display COMP-3 variable in Cobol?
What is the difference between a CALL statement and a LINK statement in COBOL?
What is the Difference between GOBACK, STOP RUN and EXIT PROGRAM in COBOL?
COBOL Interview Questions for Experienced Candidates
What are the different ways to handle date arithmetic in COBOL?
Can you Explain the differences between CALL and LINK statements in COBOL?
How can you handle file status codes in COBOL programs?
What is the purpose of the REDEFINES clause in COBOL, and how is it used?
How do you handle decimal arithmetic in COBOL, and what are the considerations for precision and scale?
Can you explain the differences between static and dynamic linking in COBOL?
What is the significance of the INITIALIZE verb in COBOL, and how is it used?
How do you handle exceptions and abnormal termination in COBOL programs?
Explain the concept of file organization in COBOL, such as sequential, indexed, and relative?
How can you handle table processing in COBOL, including search and sort operations?
What are the differences between level numbers 66 and 88 in COBOL?
Can you explain the purpose and usage of the INSPECT verb in COBOL?
How can you handle sequential and indexed file processing in COBOL?
What is the difference between CALL and CICS commands in COBOL programs?
Can you explain the differences between USING and GIVING phrases in COBOL programs?