preloader
COBOL Interview Questions

Frequently Asked COBOL Interview Questions in Job Interviews

author image

Many candidates face difficulty in acing COBOL interviews, so for them, we have brought top COBOL Interview Questions for practice. These are the questions that are frequently asked by the interviewers. Here you’ll find COBOL Interview Questions and Answers for basic, intermediate, and experienced candidates. These questions are associated with COBOL Programming Language, mainframe, features, and more. So, clear your concepts related to different topics and prepare well for 2022 job interviews.

About COBOL: COBOL was made to perform two major objectives in that one is related to portability (the ability of code to be executed with the lowest modification on computers from various manufacturers) and the second is related to readability (the ease with which a code can be read like ordinary English). In the 1990s COBOL language was widely used.

COBOL Interview Questions

1. Define COBOL?

2. Explain different data types of COBOL language?

3. Differentiate between index and subscript?

4. Differentiate between a section and a paragraph?

5. Differentiate between NEXT SENTENCE & CONTINUE?

6. What do ACCEPT verbs do?

7. Explain static and dynamic linking?

8. Explain the application of the EVALUATE statement?

9. Tell the importance of the REPLACING option of a copy statement?

10. Explain the role of the ON SIZE ERROR option in trapping error?

11. Differentiate between Structured COBOL Programming and Object-Oriented COBOL programming?

12. Describe LOCAL-STORAGE SECTION?

13. Describe INPUT PROCEDURE and OUTPUT PROCEDURE?

14. What is the application of LINKAGE SECTION?

15. Explain access modes of START statements?

16. Differentiate between Call and a Link?

17. Tell me about the use of COMP and COMP-3?

18. Tell the steps to follow to make a COBOL program suitable?

19. Name different sections of data division?

20. Describe an in-line PERFORM?

21. Name the program divisions that are mandatory for a COBOL program?

22. Differentiate between Global and External Variables?

23. What do you understand from Pic 9v99?

24. Tell me some guidelines that you need to follow while creating a structured COBOL program?

25. Tell the way to find out the present date from a system with the century?

26. Name the different divisions of COBOL?

27. Differentiate between SSRANGE and NOSSRANGE?

28. Differentiate between COMP-1 and COMP-2?

29. Tell me the use of the 77 level?

30. Tell me the use of 88 level?

31. Tell the use of level 66?

32. Tell me the use of the IS NUMERIC clause?

33. Can the OCCURS clause take place at the 01 level?

34. Explain index and subscript?

35. Explain sorting order for SEARCH ALL?

36. Explain binary search?

37. Name the Search verbs are equal to PERFORM…VARYING?

38. What mode is used for managing the sequential file and how can you describe arrays in COBOL?

39. Explain scope terminator with examples.

40. Explain the use of Pointer in the string?

41. Differentiate between a binary search and a sequential search?

42. Tell some rules to perform a SEARCH?

43. What is the case where scope terminator is mandatory?

44. The file needs to be opened in I-O mode for REWRITE purposes. State the reason?


Learn More Interview Questions Here:


COBOL Interview Questions and Answers

1. Define COBOL?

COBOL stands for Common Business Oriented Language and is one of the oldest programming languages primarily used for different business verticals, including government operations, finance, and administrative systems. It concentrates on solving complicated business problems.

2. Explain different data types of COBOL language?

Three main data types in COBOL:

  • Numeric (X): This is used to define numeric values between 0-9 in COBOL programming
  • AlphaNumeric: This data type can maintain both values together, which can be alphabetic or numeric.
  • Alphabetic: This type of COBOL can carry any of the alphabetic variables ranging between A-Z

3. Differentiate between index and subscript?

Though Subscript is understood as the occurrence of an array, an index directs to the displacement from the array’s starting. One can only change an index by utilizing PERFORM, SEARCH & SET.

4. Differentiate between a section and a paragraph?

In a section, all the paragraphs that are part of the section are to be performed. While in a paragraph, there will only be one paragraph to be performed.

5. Differentiate between NEXT SENTENCE & CONTINUE?

NEXT SENTENCE is used for moving control to the next sentence. CONTINUE works as a null statement, and it continues performing.

6. What do ACCEPT verbs do?

The ACCEPT verb is a primary statement used in COBOL for recovering data such as date, time, and day from the user or program. In the academic data, ACCEPT verbs and DISPLAY are used to obtain information for a student record.

7. Explain static and dynamic linking?

In static linking, subroutine links are known for calling programs. In dynamic linking, the main program & the subroutine can exist as different modules. Dynamic and Static linking can be accomplished by either selecting the DYNAM or NODYNAM link edit options.

8. Explain the application of the EVALUATE statement?

Evaluate is similar to a case statement. EVALUATE statements can be used such as Nested IFs. The main difference between EVALUATE and case is that, in EVALUATE, ‘break’ is left unused, and the command comes out of the EVALUATE once a match is discovered.

9. Tell the importance of the REPLACING option of a copy statement?

The REPLACING option authorizes the use of the same copy many times; it modifies the replace value in the exact code.

The coding used is COPY REPLACING BY

10. Explain the role of the ON SIZE ERROR option in trapping error?

  • fixed-point overflow
  • Zero raised to the zero power
  • Division by 0
  • Zero raised to a negative number
  • A negative number raised to a fractional power

11. Differentiate between Structured COBOL Programming and Object-Oriented COBOL programming?

Structured programming can be described as a logical way of programming. In structured programming, the functionalities are split into modules and help the developer to write the program logically.

Object-Oriented COBOL programming is a realistic way of programming. Here, developers determine the objects and then write functions and techniques around that object.

12. Describe LOCAL-STORAGE SECTION?

Every time the program is called Local-Storage is allotted, and then it is deallocated when the code stops through an EXIT PROGRAM, STOP RUN, or GOBACK. It is described in the WORKING-STORAGE SECTION after DATA DIVISION.

13. Describe INPUT PROCEDURE and OUTPUT PROCEDURE?

In the INPUT PROCEDURE, the input file is unlocked and its records are read and reworked. These records are further discharged to the sorting operation and after that finally, the file will be closed.

In the OUTPUT PROCEDURE, the output file is unlocked, the sorted record is brought back to the Output record, and after it, the record will finally be written and then the file will be closed.

14. What is the application of LINKAGE SECTION?

The linkage section helps in passing data from one code to the other code or passing data from a procedure to a program. It is characteristic of a code that maps data items in the calling program’s working storage.

15. Explain access modes of START statements?

Access modes are described as SEQUENTIAL or DYNAMIC for the beginning statement.
A call is a basic COBOL command, which starts an external program and returns. While Link is similar to Call but it doesn’t belong to a COBOL verb.

17. Tell me about the use of COMP and COMP-3?

COMP is operated for binary purposes, while COMP-3 displays packed decimals.

18. Tell the steps to follow to make a COBOL program suitable?

  • DB2 precompiler (if embedded SQL used)
  • CICS translator (if CICS pgm)
  • Cobol compiler
  • Link editor

If DB2 program, make a plan by binding the DBRMs

19. Name different sections of data division?

There are six sections in Data Division:

  • File Section
  • Working Storage Section
  • Local Storage Section
  • Screen Section
  • Report Section
  • Linkage Section

20. Describe an in-line PERFORM?

By using an IN-LINE PERFORM statement the routine is being executed to be nested in the perform statement rather than being an individual paragraph.

While the PERFORM and END-PERFORM statements help block the COBOL statements between them, in-line PERFORM works as long as there are no inner GO TOs, not even to an exit.

21. Name the program divisions that are mandatory for a COBOL program?

The identification division and the Program ID are the program divisions that are mandatory for a COBOL program.

22. Differentiate between Global and External Variables?

Global variables are present only to the batch code, while external variables can be used from any batch code in a similar system library.

23. What do you understand from Pic 9v99?

Pic 9v99 denotes a three-position numeric field with an indicated or assumed decimal point after the first position. Here, v represents an implied decimal point.

24. Tell me some guidelines that you need to follow while creating a structured COBOL program?

  • Use the ‘EVALUATE’ statement for constructing cases
  • Using scope terminators for nesting
  • Using in-line Perform statement for writing ‘do’ constructions
  • Using Test Before and Test After in the Perform statement while writing Do-While statements

25. Tell the way to find out the present date from a system with the century?

By using an Intrinsic function called Function Current Date, to find out the present date with the century.

26. Name the different divisions of COBOL?

  • DATA DIVISION
  • PROCEDURE DIVISION
  • IDENTIFICATION DIVISION
  • ENVIRONMENT DIVISION

27. Differentiate between SSRANGE and NOSSRANGE?

Both SSRANGE and NOSSRANGE are opportunities for a compiler to discover the out-of-range subscript. NOSSRANGE is the default option as there is no run-time error if the index or subscript reaches out of a range.

28. Differentiate between COMP-1 and COMP-2?

COMP-1 is a single-precision floating-point and utilizes only 4-bytes. Whereas COMP2 is the double-precision floating number and utilizes 8-bytes.

29. Tell me the use of the 77 level?

It is an Elementary level item that cannot be placed in subdivisions of other items nor can they subdivide themselves.

30. Tell me the use of 88 level?

88 level is used for condition names.

31. Tell the use of level 66?

This 66 level is used for the RENAME clause.

32. Tell me the use of the IS NUMERIC clause?

IS NUMERIC clause is operated on alphanumeric items, unsigned numeric, packed decimal items, & signed numeric. IS NUMERIC clause returns TRUE if the item only includes 0-9. However, if the item being tested is signed, then it may include 0-9, + and -.

33. Can the OCCURS clause take place at the 01 level?

No. The OCCURS clause can’t take place at the 01 level.

34. Explain index and subscript?

Subscript signifies the array occurrence, whereas the index is the displacement (in bytes) from the beginning of the array. An index can only be changed using PERFORM, SET & SEARCH.

Programmers require having an index for a table to utilize SEARCH, SEARCH ALL.

35. Explain sorting order for SEARCH ALL?

Searching orders for SEARCH ALL can either be DESCENDING or ASCENDING. If you want the search to be complete on an array sorted in descending order, then while describing the array, you should provide a DESCENDING KEY clause. ASCENDING is the default option.
A binary search is a search executed on a sorted array. One can call the item to be explored with the item at the center. If it matches with the item then it is good, else, repeat the procedure with the right half or the left half, relying on where the item lies.

37. Name the Search verbs are equal to PERFORM…VARYING?

The serial SEARCH verb is equal to the Perform-Varying statement. It is a simple search without ALL.

38. What mode is used for managing the sequential file and how can you describe arrays in COBOL?

For using a sequential file, an O-I mode (Output/Input mode) is utilized at the beginning and initiation of the processing files. Then Processing of files is defined by the successful implementation of an OPEN statement.

In COBOL, arrays can be described in the following way:

  • 05 Array1 PIC X(9), which occurs 10 times
  • 05 Array2 PIC X(9), which occurs 20 times

39. Explain scope terminator with examples.

Scope terminator is utilized for keeping the end of a verb. Examples are END-EVALUATE, EVALUATE, IF, END-IF.

40. Explain the use of Pointer in the string?

The primary purpose of Pointer is to determine the leftmost position within the receiving field where the first shared character will be stored.

In binary search, the table component key values are in ascending or descending order. The table is ‘halved’ to search for equivalent to, less than, or greater than necessities until the element is found.

In a sequential search, the table is explored from top to bottom. For this, searching the component does not have to be in a specific sequence.

The binary search is much quicker for more tables, while sequential Search functions very well with lesser tables. SEARCH ALL is utilized for binary search, while SEARCH is utilized for sequential search.

The SEARCH can be used to a table with the following conditions:

  • Which has OCCURS clause
  • INDEXED BY phrase
  • Search Index must have some initial value
  • Set the index value to 1

43. What is the case where scope terminator is mandatory?

Scope terminator is compulsory for EVALUATE statements and in-line PERFORMS. Make scope terminator expressive for good programming standards.

44. The file needs to be opened in I-O mode for REWRITE purposes. State the reason?

Even before the REWRITE is executed, the record must be extended and read from the file. For a similar purpose, the file must be opened in the I-O mode for REWRITE functionality.

Want to prepare for these languages:

Recent Articles