21.1 C
Delhi
Thursday, December 26, 2024
Home > Interview TipsCOBOL Interview Questions and Answers

COBOL Interview Questions and Answers

Common Business Oriented Language (COBOL) is an acronym for Common Business Oriented Language. It’s procedural, imperative, and object-oriented. A compiler is computer software that converts other computer programs written in a high-level (source) language into machine code, which the computer can understand. COBOL is a programming language that reads data from a file or database, processes it, and outputs it. In a nutshell, COBOL accepts input, computes it, and then outputs it.

In the context of this article, we presume that compilers convert a high-level programming language, such as COBOL, into an executable program for usage on mainframe-hosted applications, such as batch or transaction processing jobs.

COBOL has a lot of potential for a career. However, in a survey of 357 IT experts, 46% stated they were experiencing a COBOL programmer shortage, with 50% saying their COBOL team is 45 years old or older, and 22% saying they are 55 years old or older. Certainly, roughly half of the tens of thousands of users on our Facebook page for COBOL programmers are between 25 and 34, with the clear majority between 25 and 44.

You’re learning a crucial piece of computing history when you learn COBOL. In a period when computers were science fiction, you’re learning one of the first programming languages ever created. You may know how computers used to work by learning the language. You will gain an understanding of how businesses used to work. You’ll appreciate how simple things have become in the programming world and how much has been hidden from the typical coder.

You learn to be more disciplined and exacting in your programming when you know COBOL. The language can be strict and inflexible. You learn to operate with fewer resources and become more productive.

COBOL is, without a doubt, the most powerful tool in the toolbox. The original COBOL applications from the 1960s, 1970s, and 1980s are still operational with correctness and efficiency. This means that learning COBOL is more than simply learning a language; it is also learning a piece of history and a discipline that will help you become a better programmer.

These COBOL interview questions include mainframe interview questions, jcl interview questions, and db2 interview questions. 

Basic COBOL Interview Questions

1. What is binary search, and how does it work?

Use a sorted array to conduct your search. First, compare the object you’re looking for to the item in the center. If it matches, that’s great; if not, repeat the process with the left or right half, depending on where the object is located.

2. What is the purpose of EXIT?

It has no effect! It must be the only sentence in a paragraph if it is used.

3. How is the sign kept in a field for comp-3 ?

It’s tucked away in the very last smidgeon. So, if your phone number is +800, the last byte will be:

  •  hex 0C, 
  • hex 1C if it is 801, 
  • hex 2C if it is 802, 
  • hex 1D if it is -801, 
  • hex 2D if it is -802, and so on.

4. What exactly is Cobol?

COBOL is a frail and static computer programming language designed for everyday commercial use.

5. In Cobol, what is the purpose of the INITIALIZE verb?

The INITIALIZE verb sets a data item’s values to the default value. For example, alphabetic fields and altered alphanumeric items are set to spaces, whereas edited numeric items are set to zero. Fillers associated with items are left untouched.

Intermediate Cobol Interview questions 

1. What types of errors are caught by the ON SIZE ERROR option?

When the result of an arithmetic operation is larger than the fixed-point field, an ON SIZE ERROR occurs. It also appears when the number is divisible by 0. ON SIZE ERRORS can also happen when zero is raised to zero, zero is presented to a negative number, or a negative value is introduced to a fractional power.

2. How can I tell if a module is dynamic or statistical?

The result of the module can be determined solely by looking at the output of the linkage editor or the load module. The module is dynamically called if it does not exist in the main module. It is called statically if it exists in the load module.

3. When is it necessary to use a scope terminator? 

In COBOL, scope terminators are required in in-line PERFORMS and EVALUATE statements. Therefore, it is recommended coding practice always make scope terminators explicit for ease of reading.

4. Why is it necessary to open a file to REWRITE?

It is necessary to open the record and read it from the file to conduct REWRITE. As a result, the file must be opened in I-O mode before performing the rewriting function.

5. In Cobol, what is the LINKAGE SECTION?

In Cobol, the linkage section conveys data from one program to another or a procedure to a schedule.

6. In Cobol, what are the 66 and 88 levels used for?

In Cobol, the RENAMES clause is implemented at Level 66, while condition names are implemented at Level 88.

7. What is Cobol’s length?

It’s a custom register with the length of an essential item or a set of items.

8. What is the difference between a SSRANGE and a NOSSRANGE in Cobol?

The SSRANGE compiler option deals with array overflow. In the COBOL programming language, SSRANGE must also be supplied. These are useful for locating a subscript that is out of range.

For performance-critical applications, NOSSRANGE is employed. In addition, nOSSRANGE is the default option, which means that if the index or subscript is out of range, there will be no runtime error.

9. Write out some of COBOL’s properties as a business language.

COBOL is a popular programming language that has been assisting corporate customers for decades. The following are the characteristics of COBOL as a business language:

  • It can be compiled, executed, and combined on a variety of machines.
  • It is a business-oriented application that can manage massive amounts of data.
  • It has multiple versions that simplify debugging and includes several debugging and testing tools for business users.

10. In COBOL, what are the various data types?

In its programming structure, COBOL supports three data kinds. They are:

  • alpha-numeric in nature (X)
  • alphabetical order (A, B, C)
  • Numbers (1,2,3)

11. Define the terms static and dynamic linking.

In COBOL, there are two forms of linking: 

static and dynamic linking.

Subroutines in static linking are embedded in the calling program and do not exist as independent modules.

The subroutine does not link into the main program and exists as a distinct module in the dynamic module.

For both static and dynamic linking, the DYNAM and NODYNAM link edit options can be employed. 

12. What is structured COBOL programming, and how does it work?

Functionalities are split into modules in this.

It is a logical approach of programming that aids in the logical writing of code.

Data hiding is not available in Structured COBOL programming; hence it is less secure.

13. What is COBOL object-oriented programming?

The functions and procedures are written after the objects have been recognised.

It’s a natural programming style.

It is more secure than structured COBOL programming because it includes a data concealing mechanism.

Advanced Cobol interview questions.

1. What is the difference between INPUT PROCEDURE and OUTPUT PROCEDURE?

INPUT PROCEDURE– This specifies how input files are opened for the first time. Records are read, modified, and altered after they have been opened. It then performs sorting procedures before closing the files.

OUTPUT PROCEDURE– It specifies the operations when the output file is first opened, and the sorted record in the output record is received. The file is then written and then closed.

2. Mention the rules for writing a well-structured COBOL program?

When writing a structured COBOL program, there is a format that must be followed. To create a structured COBOL in order to design a case, one must follow these criteria and always employ EQUIVALENT statements.

Nesting is done with scope terminators.

For writing ‘do’ structures, IN-LINE PERFORM statements are used. Also, while writing do-while statements, use Tests before and Tests after in performing statements.

3. In the data division, give each part a name. 

The name assigned to data in the programs that it manipulates is given by data division. It is divided into six pieces:

  • The fields within the records of each file in the program are defined in the file section.
  • The names of the data that the application utilises for data modification are defined in the working storage section.
  • When the application performs in-out through forms, the screen section is employed.
  • The report section is used to create reports.
  • Section regarding hyperlinks.
  • It is used to call COBOL programs from the local storage section.

4. What are the various rules for searching? 

The OCCURS clause in the table is a requirement for conducting a search function in it.

Therefore, INDEXED BY phrases should be used.

Set the index value to 1 at all times.

5. In the COBOL programming language, what is the difference between NEXT SENTENCE and CONTINUE? 

NEXT STATEMENT is used in the COBOL language to control the next verb after the next period. The next Sentence is a group of sentences that end with (.) such that control is passed to the next verb after the next period. Therefore, one will not be added to the input count when NEXT SENTENCE is typed.

After the explicit scope terminator, the CONTINUE statement is used to govern the next verb. When CONTINUE is coded, the input count will be increased by one.

6. What are the various rules for carrying out a SORT operation?

When two or more files are merged, SORT processes are executed. It’s used to sort data into ascending or descending order. When conducting SORT operations, the following guidelines must be followed:

  • Both the input and output files must be closed at the end of the process. The input file is the one that must be sorted in a specific order.
  • The output file contains the results of the sorting procedure. During the SORTING procedure, we must ensure that both of these files are closed.
  • Working files should contain a SELECT clause. Work files are used to store records while they are being sorted.
  • FD entries must be present in both the input and output files.
  • Also, in the file part of work files, there should be brief descriptions.

7. In a COBOL program, what are the divisions?

A COBOL program is divided into four sections. Identification, environment, data, and process are the four categories. The essential division is identification, which identifies the program. Configuration and input-output are the two sections of the environment division. It establishes the written program’s environment. Within the program, the data division is used to identify data items, assign memories, and define names. It features an area for files, working storage, and linking. The procedure division is in charge of the program’s logic. It must include at least one statement that uses user-defined variables.

8. Is COBOL still in use, and is it still worthwhile to learn?

Yes, COBOL is still worthwhile to understand, regardless of whether the user or programmer intends to maintain or port COBOL programs to other programming languages. It would be simple to do with COBOL. Although the language is almost 60 years old, there has recently been an increase in demand for it due to government needs. In the midst of the pandemic, programmers have been utilising COBOL in state government processes to handle unemployment claims.

9. What distinguishes COBOL from other business languages?

COBOL is a business-oriented programming language. It contains a number of features that assist organisations in managing and updating data. COBOL is a commercial language that can handle massive data sets. COBOL can be compiled, executed, and combined on multiple machines by programmers. When someone is looking for solutions, it can also be utilised for debugging and testing tools. COBOL comes in a variety of variants, each with its own set of features.

10. What is the definition of a report item?

A report item is a printable field with Edit Symbols.

11. What is Cobol’s length? 

The length of a group or a basic item is kept in a specific register.

12. What is the purpose of a copy statement’s REPLACING option?

By modifying the replace value, REPLACING allows the same copy to be used several times in the same code.

Conclusion

These are the top 30 COBOL interview questions, according to research. These COBOL interview questions were prepared after conducting extensive research and reviewing a variety of COBOL interview questions that have been asked in written tests.

More Resources : Part time jobs in Indore | Part time jobs in Noida | Cover letter for internship | Business analyst resume

- Advertisement -spot_img

More articles

spot_img

Latest article

Build resume using templates

Explore urgently hiring jobs

Personalized jobs for you