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.
The complete form of COBOL is a 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-
Now that we have gained a basic knowledge of COBOL, let's move on to the COBOL Interview Questions- 2023 (updated) for each of the following two separately-
Top 10 COBOL Interview Questions and Answers
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}
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}]
We use level 66 for RENAMES clause, whereas level 88 for condition names.
The ON SIZE ERROR can trap the following errors-
Looking forward to a career in a Programming & Frameworks Courses domain? Check out the "Python Training" and get certified today |
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.
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
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-
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
The following are the rules of SORT operation-
The following six sections are available in the Data Division-
The following arrays can be defined in COBOL-
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. |
The following syntax is used for using the SORT command-
ORT file_1 ON ASCENDING/DESCENDING KEY
USING file_2
GIVING file_3
Where,
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.
A variable block file can be identified when it meets the following 4 conditions-
The main reasons for the occurrence of S0C1 are-
The main reasons for the occurrence of S0C5 are-
The main reasons for the occurrence of S0C7 are-
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.
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 |
Some of the major companies that use COBOL are-
The most popular alternatives to COBOL include Java, Python, Cobalt, JavaScript, and C language.
The main features of COBOL are given below-
The following three are the main data types among the five data types in COBOL-
We can use open modes for the following-
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.
Related Article: VSAM Interview Questions |
The following divisions are available in a COBOL program:
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.
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.
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.
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.
Name | Dates | |
---|---|---|
Python Training | Oct 15 to Oct 30 | View Details |
Python Training | Oct 19 to Nov 03 | View Details |
Python Training | Oct 22 to Nov 06 | View Details |
Python Training | Oct 26 to Nov 10 | View Details |
Kalla Saikumar is a technology expert and is currently working as a Marketing Analyst at MindMajix. Write articles on multiple platforms such as Tableau, PowerBi, Business Analysis, SQL Server, MySQL, Oracle, and other courses. And you can join him on LinkedIn and Twitter.