Home  >  Blog  >   General  > 

COBOL Interview Questions

Do you want to become a software developer or, more specifically COBOL developer? Are you preparing for the job interviews? Do you want to ensure that you have done quality preparation? Do you want guidance on the type of COBOL Interview Questions that could be asked? Then get on board and check out this compilation of COBOL Interview Questions that we have prepared for you. Make sure you go through these at least once before your interview.

Rating: 4.5
  
 
243
  1. Share:
General Articles

The complete form of COBOL is Common Business-Oriented Language. It is a compiled English-like high-level programming language meant primarily for business applications. Its highlight is that it was the first widespread language agnostic to operating systems. It came out as an object-oriented language in 2002. And it is an imperative part of many large businesses, financial institutions, and administrative systems for governments and companies. This language development was a United States Department of Defense-sponsored project including a consortium of companies like Honeywell, IBM, and Burroughs.

Let us go through these essential but valuable insights about COBOL-

  • Despite being old, COBOL is used in almost every field, from government agencies to our local bank. Around 95% of ATM swipes and 43% of banking systems depended on COBOL for their operations in 2020.
  • A COBOL developer can earn an average of almost $50 per hour or $97,500 per annum in the USA. And the range varies from $83,900 per annum for entry-level developers to $122,850 per annum for experienced ones.

Now that we have gained a basic knowledge of COBOL, let's move on to the COBOL Interview Questions- 2022 (updated) for each of the following two separately-

  1. Freshers
  2. Experienced
  3. FAQ's

Top 10 COBOL Interview Questions and Answers

  1. Explain the CONTINUE statement in COBOL.
  2. Explain the use of EVALUATE statement.
  3. Differentiate between the CALL and LINK commands.
  4. Differentiate between subscript and index in COBOL.
  5. Differentiate between a binary and sequential search.
  6. Define the arrays available in COBOL.
  7. When is S0C1 caused?
  8. When is S0C7 caused?
  9. Mention some popular competitors and alternatives to COBOL.
  10. Define the INPUT PROCEDURE and OUTPUT PROCEDURE.

COBOL Interview Questions and Answers for Freshers:

1. Explain the NEXT SENTENCE statement in COBOL.

The control is simply transferred by the NEXT SENTENCE statement to an implicit CONTINUE statement present immediately after the next separator period. The control is transferred after the closest following period when this statement is used along with the END-IF statement. Its main function is transferring control to the next sentence.

IF condition-1 THEN
   {statement-1 … I NEXT SENTENCE}

2. Explain the CONTINUE statement in COBOL.

The CONTINUE statement is a null statement by which no operation is indicated. And we need to pass the control after the explicit scope terminator to the next executable instruction. We can use it anywhere in the imperative statements or conditional statements.

IF condition-1 THEN
      {statement-1 …   I CONTINUE}
[ELSE     {statement-2 …I CONTINUE}]

3. When do you use 66 and 88 levels in COBOL?

We use level 66 for RENAMES clause, whereas level 88 for condition names.

4. What is the error that is trapped by the ON SIZE ERROR option?

The ON SIZE ERROR can trap the following errors-

  1. Fixed-point overflow
  2. Division by 0
  3. 0 raised to the power of 0
  4. A fractional power on a negative number
  5. 0 raised to a negative number

5. Explain the use of EVALUATE statement.

Evaluate statement is a kind of case statement. We can also use it like Nested Ifs. The EVALUATE statement differs from the case statement because the EVALUATE statement doesn't use the 'break'. And after the match is found, the control gets out of the EVALUATE.

Looking forward to a career in a Programming & Frameworks Courses domain? Check out the "Python Training" and get certified today

6. What does the REPLACING option do in a copy statement?

We can use the same copy in the same code more than once by the change of replacing value through REPLACING option.

COPY<Name>REPLACING BY

7. What do you mean by literals?

A literal is the data item consisting of the value by itself. We can't refer to it by name. These data items are constant, and they are of the following two types-

  • Numeric literals
  • String/alphabetic literals

8. Differentiate between SSRANGE AND NOSSRANGE.

The compiler uses both of them to find subscripts outside of range. We use SSRANGE to handle an array's overflow systematically. We need to specify it explicitly to find an exact subscript outside the range. On the other hand, we use NOSSRANGE in very sensitive applications driven by performance. This is the default option that gets applied automatically. The runtime errors are not supported in the case of the index going out of range.

 MindMajix YouTube Channel

9. Why do you need a LINKAGE SECTION?

We need it to pass the data from one program to another. We can also use it to pass the data from a procedure to another program. The data is mapped in the working storage of the calling program with this section.

10. Differentiate between the CALL and LINK commands.

The CALL command is an actual command used for initiating and returning an external program. The LINK command is also like the CALL command but the fact that it is not contained in the verb vocabulary of COBOL. The CALL runs as a single-run unit. On the other hand, the LINK command is run as a separate run unit.

11. Why should the OCCURS clause not be defined at the 01 levels?

O1 level is referred to as the level of record. The field can be repeated within a record, but the record itself can't be repeated. The definition of data names' repetition is indicated by the OCCURS clause. And that's why the OCCURS clause can't be defined at the 01 levels.

12. Mention the importance of INITIALIZE verb.

We use the INITIALIZE verb to initialize values to their default value in data items. The alphabetic and alphanumeric values get set to spaces, and the numeric values get set to 0. We leave the items, including OCCURS DEPENDING ON and FILLERS, untouched while the initialization process takes place.

13. How can the current date within a century be found in the system?

The intrinsic function known as FUNCTION CURRENT-DATE is used for finding the current date within a century. The DATE function can also be used to accept the current date. But the current date will not get accepted while the CICS COBOL programs are being used.

14. Differentiate between subscript and index in COBOL.

The occurrence of an array is referred to as a subscript, while the displacement from the array's beginning is referred to as an index.

We can modify an index using only SEARCH, PERFORM, and SET.

15. Tell us about Static and Dynamic linking.

The subroutine gets linked into the calling program in the Static linking. On the other hand, the main program and subroutine exist as separate values in the dynamic linking. The DYNAM and NODYNAM link edit options can be used for achieving static as well as dynamic linking.

COBOL Interview Questions and Answers for the Experienced

1. What is meant by an IN-LINE PERFORM?

We can nest the route being performed within the perform statement itself using an IN-LINE PERFORM statement rather than a separate paragraph.

We use the PERFORM and END-PERFORM statements to block the COBOL statements between them. But the IN LINE PERFORM statement works only as long as the internal GO TOs (including the exit GO TO) are not there.

2. What do Pic 9v99 and Pic 9.99 indicate?

An implied decimal point is meant by v here. And Pic 9v99 is a three-position Numeric field, implying or assuming a decimal point after the first position.

On the other hand, Pic 9.99 is a four-position field containing a decimal point.

3. Differentiate between a binary and sequential search.

The table element key values are arranged in ascending or descending order in a Binary search. And the table is divided into two parts for searching equal to, less than, or greater than conditions till it finds the element.

On the other hand, the elements are not in any particular sequence in a sequential search as the search is carried out in the table from top to bottom.

4. Mention the various rules of SORT operation.

The following are the rules of SORT operation-

  • The select clause must be there in a working file.
  • The Input and output files should be closed.
  • The input and output files must possess the FD entries.
  • There should be a short description of the work file.

5. List down the sections available in Data Division in COBOL.

The following six sections are available in the Data Division-

  1. File section
  2. Screen section
  3. Working storage section
  4. Report section
  5. Local storage section
  6. Linkage section

6. Define the arrays available in COBOL.

The following arrays can be defined in COBOL-

  1. The 05 Array1 PIC X (9) occurs 10 times.
  2. The 05 Array2 PIC X (9) occurs 20 times.

7. What is the difference between OS/VS COBOL and VS COBOL 2?

OS/VS COBOL VS COBOL 2
It executes in 24-bit addressing mode. It executes in either 31-bit or 24-bit addressing modes.
The report writer is supported. The report writer is not supported.
It supports USAGE IS POINTER. It doesn't support USAGE IS POINTER.
It doesn't support the reference modification. It supports the reference modification.
It doesn't support the scope terminators. It supports the scope terminators.
ANSI 74 standards are followed here. It follows ANSI 85 standards.
It doesn't support EVALUATE. It supports EVALUATE.
It doesn't support the calls between programs under the Customer Information Control System (CICS). It supports the calls between programs under CICS.

8. How can sorting be achieved in COBOL?

The following syntax is used for using the SORT command-

ORT file_1 ON ASCENDING/DESCENDING KEY
USING file_2
GIVING file_3

Where,

  • File_1 is the sort work file that we need to describe using the FILE SECTION's SD entry.
  • File_2 is the input file for SORT. We need to describe this using the FILE SECTION's FD entry and the FILE CONTROL's SELECT clause.
  • File_3 is the output file from SORT. We need to describe this also using FILE SECTION's FD entry and FILE CONTROL's SELECT clause.

9. Why should you open the file in I-O mode while using it for rewriting?

We must first open the file and then read the record from the file whenever the REWRITE function is being used. This is the reason why we should always open the file in I-O mode.

10. How can you identify if the file is a variable block file?

A variable block file can be identified when it meets the following 4 conditions-

  1. The organization is sequential.
  2. 0 is contained in the block.
  3. The recording mode is V.
  4. FD never codes the record length as 4 bytes.

11. When is S0C1 caused?

The main reasons for the occurrence of S0C1 are-

  • When an operation is read or written on an unopened dataset.
  • The DD name is incorrectly spelt.
  • When we call the subprograms, they are not found.

12. When is S0C5 caused?

The main reasons for the occurrence of S0C5 are-

  • When an incorrect exit occurs from a platform.
  • The index or subscript is damaged.
  • When an unopened dataset is tried to be closed.
  • When the I/O is accessed before the operation is read.

13. When is S0C7 caused?

The main reasons for the occurrence of S0C7 are-

  • When the work is done upon uninitialized storage.
  • Whenever we perform numeric operations on the non-numeric data type.
  • When excessive code is done, surpassing the maximum limit of permitted dub script.

14. Explain the terminologies- AMODE(24), AMODE(31), RMODE(24), and RMODE(ANY).

All of are the compile or link editing options.

AMODE refers to Addressing Mode. AMODE(24) represents the 24-bit addressing mode, and AMODE(31) represents the 31-bit addressing mode.

RMODE refers to Resident Mode. RMODE(24) represents the residence of a mode within the below 16 Meg line virtual storage. RMODE(ANY) represents the residence of any level below or above the 16 Meg line.

15. When is the need for scope terminators mandatory?

When the EVALUATE statements or IN-LINE PERFORMS are used, then the scope terminators are mandatory. That is because it makes reading the code better as well as easy.

Preparing for Python Interview? Here are the Top Python Interview Questions and Answers

Frequently Asked COBOL Interview Questions and Answers:

1. List out the major companies that use COBOL.

Some of the major companies that use COBOL are-

  1. Lewis
  2. Lorven Technologies
  3. JPMorgan Chase
  4. U.S. Bank
  5. Centene Corporation
  6. fema.gov
  7. IBM
  8. UPS
  9. Cigna

2. Mention some popular competitors and alternatives to COBOL.

The most popular alternatives to COBOL include Java, Python, Cobalt, JavaScript, and C language.

3. What are the main features of the COBOL programming language?

The main features of COBOL are given below-

  1. Universality- COBOL is almost six decades old. And it has expanded to almost every product, platform, and compiler in this time.
  2. Simplicity- It has a simple and easy-to-learn syntax, and the coding style is uncluttered as well.
  3. Scalability- COBOL is a highly portable language across different platforms. The variable control features provided make reading, modifying, and debugging very easy.
  4. Business-oriented capabilities- COBOL is capable of handling a huge amount of data and processing simple as well as complex operations. Thus business transactions can be handled efficiently.

4. What are data types available in the COBOL language?

The following three are the main data types among the five data types in COBOL-

  • Alphabetic data type- Alphabetic values (A-Z) can be represented.
  • Numeric data type- Numerical values (0-9) can be represented.
  • Alphanumeric data type- Both alphabetic and numeric values are represented by this.

5. List the various OPEN modes present in COBOL.

We can use open modes for the following-

  1. Input
  2. Output
  3. Input-Output
  4. Extend

6. Differentiate between Object-Oriented COBOL programming and Structured COBOL programming.

Object-Oriented COBOL programming enables writing the code naturally. Here, the objects are identified, and the procedures, as well as functions, are written around that object.

Structured programming enables writing the code logically. It divides the functionalities into modules, and then the code is written logically.

7. List down the divisions that are available in a COBOL program.

The following divisions are available in a COBOL program-

  1. Identification division
  2. Environment division
  3. Data division
  4. Procedure division

8. Why is COBOL still worth learning?

Whether a developer wants to maintain or port to other languages for programming, COBOL is worth learning in any situation. We can do it easily using COBOL. This is in high demand by some government agencies despite being 60 years old. The unemployment benefits have been handled by the state authorities amid the pandemic.

9. What guidelines should be taken care of while you write a structured COBOL program?

A certain format should be followed while writing a structured COBOL program to implement the code correctly. For instance, EQUIVALENT statements can be used each time a case is constructed. Terminators should be used while nesting. And IN-LINE PERFORM statements should be used when we want the program to do something. For do-while loop statements, TEST BEFORE and TEST AFTER statements can also be used.

10. Define the INPUT PROCEDURE and OUTPUT PROCEDURE.

We can open the input file and read and edit the records during an INPUT PROCEDURE. Then we release these records to the sorting operation. And finally, we closed the file.

We can open the output file, return the sorted record to the Output record, and then write the code during an OUTPUT PROCEDURE. Then the file gets closed.

Conclusion:

These days there is a shortage of experts with the know-how of COBOL because of the prevalence of several new languages. Therefore, it has become a major task for companies to find COBOL developers to maintain the older programs. Further, the use of COBOL systems has raised multi-fold because of the recent global health crisis. This has taken the demand for COBOL developers to the next level. Hence it becomes the right time to apply for these jobs. And the COBOL Interview Questions provided here will provide you with an edge over others in your interviews. So make sure you are giving your best this time with these questions.

Join our newsletter
inbox

Stay updated with our newsletter, packed with Tutorials, Interview Questions, How-to's, Tips & Tricks, Latest Trends & Updates, and more ➤ Straight to your inbox!

Course Schedule
NameDates
Python TrainingDec 03 to Dec 18
Python TrainingDec 06 to Dec 21
Python TrainingDec 10 to Dec 25
Python TrainingDec 13 to Dec 28
Last updated: 29 November 2022
About Author
SaiKumar Kalla

Kalla Saikumar is a technology expert and is currently working as a content associate at MindMajix. Write articles on multiple platforms such as ServiceNow, Business Analysis, Performance Testing, Mulesoft, Oracle Exadata, Azure, and other courses. And you can join him on LinkedIn.

Recommended Courses

1 /15