Thursday, 15 April 2021

COBOL interview questions | MF COBOL Interview Questions 2021 | [Best COBOL interview questions].

COBOL Interview Questions, Best COBOL Interview Questions

COBOL Interview Questions.


Welcome back to today's session on "COBOL Interview Questions". In this, interview question you'll go through different MF COBOL Interview questions and answers that cover different topics from COBOL. Let's get started with the best COBOL interview questions.    


What is the initialize verb in COBOL and what is the difference between initialize and MOVE spaces in COBOL?

Initialize verb in COBOL is used to initialize the variables with the default value (i.e. SPACE or ZEROES). An INITIALIZE statement is functionally equivalent to one or more MOVE statements.

Generally, the COBOL INITIALIZE statement is used to initialize all the group data items without any hassle. However, it is unproductive to initialize an entire group unless you require all the items in the group to be initialized.
  • Alphabetic, Alphanumeric fields & alphanumeric edited variables are set to SPACES.
  • Numeric, Numeric edited items set to ZERO.
  • FILLER, OCCURS DEPENDING ON items left intact.

What is the difference between levels 66, 77, and 88 and what are they used for?

Well, Levels 66, 77, and 88 are functionally different and are used for different purposes. 
  • Level 66 is a RENAME Clause and is used for rename items. 
  • Level 77 is an elementary level item. It cannot have group items. 
  • Level 88 is used to specify the condition name. 

What is the difference between index and subscript in COBOL?

The subscript and index in COBOL are used to access items from the COBOL array/table. The subscript in COBOL refers to the array occurrence. However, an index in COBOL is the displacement of an item from the beginning of the array. An index in COBOL can only be changed by using COBOL PERFORM statement, COBOL SEARCH, and SET statement in COBOL.

You must always use an index for a table to use COBOL SEARCH or COBOL SEARCH ALL statements.

What is the difference between SEARCH and SEARCH ALL in COBOL?

The COBOL SEARCH and COBOL SEARCH ALL are used to search data within the table/array. COBOL SEARCH is a serial search. However, COBOL SEARCH ALL is a binary search and it is faster and more efficient as compared to SEARCH. The data in table/array should be sorted either in ASCENDING/DESCENDING before using COBOL SEARCH ALL.

What should be the sorting order for COBOL SEARCH ALL?

The data in the COBOL array/table should be sorted in a specific sequence i.e. either ASCENDING or DESCENDING. The default data sorting order is ASCENDING. If you need to search the data in descending order, you must use DESCENDING KEY Clause while declaring the array.

What is the basic difference between performing a SECTION and a PARAGRAPH in COBOL?

The COBOL PERFORM statement is used to execute a business logic defined in the paragraph or section. Performing a SECTION means executing a group of paragraphs within the section. However, performing a PARAGRAPH means executing a particular paragraph logic.

What is the COBOL EVALUATE statement and why it is recommended over the COBOL IF/ELSE statement?

The COBOL Evaluate statement is like an excel case statement and can be used instead of nested Ifs statements. The main difference between EVALUATE in COBOL and case is that no 'break' is required for EVALUATE i.e. control comes out of the EVALUATE as soon as criteria are satisfied.

You can use the EVALUATE statement instead of a series of nested IF statements to test several conditions and specify a different action for each. It is always recommended to use COBOL Evaluate instead of nested Ifs. 

What is the difference between COBOL CONTINUE and NEXT COBOL SENTENCE Statement?

In general, both the COBOL CONTINUE statement and NEXT SENTENCE in COBOL are used to transfer control to the next executable statement. But, there is a difference in the way control is transferred. The NEXT SENTENCE transfers control to the next executable statement after a period ".", but the CONTINUE statement transfers control after the explicit scope terminator such as end-if, end-evaluate, etc.

Is it possible to REDEFINE an X(50) field with a field of X(100)?

Yes, it is possible. COBOL REDEFINE statement is used to define the same field in two or more ways. It means, that definition and the redefinition of both fields refer same storage.

01 WS-FNAME       PIC X(50).
01 WS-EMP-NAME  REDEFINES WS-FNAME  PIC X(100).

What is the difference between COMP & COMP-3 and how is sign stored in COMP-3 fields?

Both COMP and COMP-3 in COBOL are used to define the storage format of numerical fields. COMP in COBOL represents the binary format while COMP-3 in COBOL represents the packed decimal format. In COMP-3 the sign is stored in the last nibble. 

COBOL Interview Questions and Answers!

 

Conclusion. 

Finally, this marks an end to the COBOL Interview Questions and answers. These interview questions are designed for both experienced and fresher. With the help of these COBOL interview Questions, you can easily clear your interview questions. Do check out COBOL LEVEL 88 Condition.


Subscribe to Topictrick & Don't forget to press THE BELL ICON to never miss any updates. Also, Please visit mention the link below to stay connected with Topictrick and the Mainframe forum on - 

► Youtube
► Facebook 
► Reddit

Thank you for your support. 
Mainframe Forum™

No comments:

Post a Comment

New In-feed ads