COBOL Interview Questions

COBOL interview questions

Cracking an interview has never been easy as history states. The questions that an interview asks are unpredictable and are quite difficult to answer if you don’t what the answer is. However, these one or two questions that you have not answered might decide your future as the interviewer can reject your application stating some obvious reasons which cannot be neglected. Therefore, in order to crack an interview with flying colors, leverage our COBOL interview questions and answers that are prepared by the experts and professionals who have adequate knowledge and expertise in this field.

About COBOL

COBOL or Common Business Oriented Language is a programming language that is considered to be of high-level and is mostly used to develop business applications. It is also popularly known as the first language that was designed to be the OS agnostic and is also used until now to develop financial as well as business applications. COBOL was introduced for business computer-based programs in industries like finance or human resources. COBOL mostly uses normal English words and some phrases to make it completely easier to operate all the ordinary businesses easily so that the users understand the language without facing any hassles or troubles.

Best COBOL Interview Questions of 2020

1. What do you know about COBOL?

COBOL stands for Common Business-Oriented Language. The US Department of Defense, in a conference, formed CODASYL (Conference on Data Systems Language) to develop a language for meeting business data processing needs which is now known as COBOL.

2. List some features of COBOL.

COBOL is a standard language that can be compiled and executed on various machines. It is ideally suited for business-oriented applications as it can handle huge volumes of data. It provides numerous debugging and testing tools. COBOL is a structured language; it has different divisions, so it is easy to debug.

3. Name the divisions in a COBOL program.

Identification Division, Environment Division, Data Division, and Procedure Division.

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

Alpha-numeric (X), Alphabetic (A), and Numeric (9).

5. What is 'IS NUMERIC' clause?

IS NUMERIC clause is used to check if any item is numeric or not. It returns TRUE when the item against which it is used contains only numbers (0 to 9). The item can be positive or negative.

6. What are 66 and 88 level used for?

Level 66 is used for RENAMES clause and Level 88 is used for condition names.

7. What is the difference between subscript and index?

Subscript is the occurrence in an array. Index is the displacement from the beginning of an array.

8. What is the difference between SEARCH and SEARCH ALL?

SEARCH is a serial search, whereas SEARCH ALL is a binary search. A table must be in sorted order before using SEARCH ALL.

9. What Is Binary Search?

Search on a sorted array. Compare the item to be searched with the item at the center. If it matches, fine else repeat the process with the left half or the right half depending on where the item lies.

10. My Program Has An Array Defined To Have 10 Items. Due To A Bug, I Find That Even If The Program Access The 11th Item In This Array, The Program Does Not Abend. What Is Wrong With It?

Must use compiler option SSRANGE if you want array bounds checking. Default is NOSSRANGE.

11. How Do You Define A Sort File In Jcl That Runs The Cobol Program?

Use the SORTWK01, SORTWK02,..... dd names in the step. Number of sort datasets depends on the volume of data being sorted, but a minimum of 3 is required.

12. What Is The Difference Between Performing A Section And A Paragraph?

Performing a SECTION will cause all the paragraphs that are part of the section, to be performed. Performing a PARAGRAPH will cause only that paragraph to be performed.

13. What Is The Use Of Evaluate Statement?   

Evaluate is like a case statement and can be used to replace nested Ifs. The difference between EVALUATE and case is that no 'break' is required for EVALUATE i.e. control comes out of the EVALUATE as soon as one match is made.

14. What Are The Different Forms Of Evaluate Statement?

EVALUATE EVALUATE SQLCODE ALSO FILE-STATUS
WHEN A=B AND C=D WHEN 100 ALSO '00'
imperative stmt imperative stmt 
WHEN (D+X)/Y = 4 WHEN -305 ALSO '32'
imperative stmt imperative stmt
WHEN OTHER WHEN OTHER
imperative stmt imperative stmt
END-EVALUATE END-EVALUATE
EVALUATE SQLCODE ALSO A=B EVALUATE SQLCODE ALSO TRUE
WHEN 100 ALSO TRUE WHEN 100 ALSO A=B
imperative stmt imperative stmt
WHEN -305 ALSO FALSE WHEN -305 ALSO (A/C=4)
imperative stmt imperative stmt
END-EVALUATE END-EVALUATE.

16. How Do You Come Out Of An Evaluate Statement?

After the execution of one of the when clauses, the control is automatically passed on to the next sentence after the EVALUATE statement. There is no need of any extra code.

17. What Is A Scope Terminator? Give Examples?

Scope terminator is used to mark the end of a verb e.g. EVALUATE, END-EVALUATE; IF, END-IF.

18. How Do You Do In-line Perform?

PERFORM ... ... 
END PERFORM.

19. When Would You Use In-line Perform?

When the body of the perform will not be used in other paragraphs. If the body of the perform is a generic type of code (used from various other places in the program), it would be better to put the code in a separate para and use PERFORM paraname rather than in-line perform.

20. What Is The Difference Between Continue & Next Sentence ?

CONTINUE is like a null statement (do nothing) , while NEXT SENTENCE transfers control to the next sentence (!!) (A sentence is terminated by a period).

21. What Does Exit Do ?

Does nothing ! If used, must be the only sentence within a paragraph.

22. How Is Sign Stored In Packed Decimal Fields And Zoned Decimal Fields?

Packed Decimal fields: Sign is stored as a hex value in the last nibble (4 bits ) of the storage. Zoned Decimal fields: As a default, sign is over punched with the numeric value stored in the last bite.

23. How Is Sign Stored In A Comp-3 Field?

It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C if your number is 101, hex 2C if your number is 102, hex 1D if the number is -101, hex 2D if the number is -102 etc...

24. How Is Sign Stored In A Comp Field ?

In the most significant bit. Bit is on if -ve, off if +ve.

25. What Is The Difference Between Comp & Comp-3 ?

COMP is a binary storage format while COMP-3 is packed decimal format.

26. What Is Comp-1? Comp-2?

COMP-1 - Single precision floating point. Uses 4 bytes.
COMP-2 - Double precision floating point. Uses 8 bytes.

27. How Do You Define A Variable Of Comp-1? Comp-2?

No picture clause to be given. Example 01 WS-VAR USAGE COMP-1.

28. How Many Bytes Does A S9(7) Comp-3 Field Occupy?

Will take 4 bytes. Sign is stored as hex value in the last nibble.
General formula is INT((n/2) + 1)), where n=7 in this example.

29. How Many Bytes Does A S9(7) Sign Trailing Separate Field Occupy?

Will occupy 8 bytes (one extra byte for sign).

30. How Many Bytes Will A S9(8) Comp Field Occupy ?

4 bytes.

31. What Is The Maximum Value That Can Be Stored In S9(8) Comp?

99999999

32. What Is Comp Sync?

Causes the item to be aligned on natural boundaries. Can be SYNCHRONIZED LEFT or RIGHT.

For binary data items, the address resolution is faster if they are located at word boundaries in the memory. For example, on main frame the memory word size is 4 bytes. This means that each word will start from an address divisible by 4. If my first variable is x(3) and next one is s9(4) comp, then if you do not specify the SYNC clause, S9(4) COMP will start from byte 3 ( assuming that it starts from 0 ). If you specify SYNC, then the binary data item will start from address 4. You might see some wastage of memory, but the access to this computational field is faster.

33. What Is The Maximum Size Of A 01 Level Item In Cobol I? In Cobol Ii?

In COBOL II: 16777215.

34. What Are Different File Open Modes Available In Cobol?

Open for INPUT, OUTPUT, I-O, EXTEND.

35. What Is The Mode In Which You Will Open A File For Writing?

OUTPUT, EXTEND.

Career scopes and salary scale

As there are lots of financial institutions who use this application to make their processes smoother and easier, if you are well-versed with COBOL language programming, then you definitely have an opportunity to pursue your career in this field without thinking much. The opportunities in this field are incredible for the freshers as well as experienced. Don’t miss this opportunity at all. For a fresher, he or she has scope to make about 83,000 dollars per annum, while for an experienced candidate, he or she can up to 150,000 dollars per annum based on the skill set he or she is possessing.

Conclusion

Cracking an interview has never been so easy before as you have the option to explore our COBOL interview questions and answers that are prepared by our experts. In case of any doubts or discrepancies, you can feel free to drop us a message and we will look into it as soon as possible.

Intellinuts Terms : A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z