Level Numbers Interview Questions


What is a level number in COBOL?

Level numbers play the most important role in declaring the variables in the application programs. They specify the hierarchy or level of data items or variables.

How many types of level numbers based on its usage?

Level numbers are of two types based on their usage purpose -

  • General purpose level numbers (01 to 49)
  • Special purpose level numbers (66, 77 and 88)

What is the general-purpose level numbers?

General purpose level numbers declare regular variables that simply process the data. The level number hierarchy starts from 01 to 49.

Elementary items cannot be divided further. Level number, Data name, Picture clause and Value clause (optional) are used to describe an elementary item. State whether True or False?

False

66 Level Number -

What is level 66 used for?

Level number 66 is used to create another logical group by regrouping the elementary variables of a group. RENAMES keyword is used along with the 66-level number to rename the group.

77 Level Number -

What is 77 level used for?

Variables have no immediate relationship to any other variables. Those variables are called Individual variables. Special purpose level number 77 is to declare individual variables.

88 Level Number -

What is 88 level used for?

88-level number provides a descriptive name for a condition. The name associated with 88 level numbers is called as Condition Name, and the variable with 88 level numbers attached to it is called as Conditional Variable.

How the condition names is declared in COBOL program?

For example -

 01 WS-GENDER       PIC X(01) VALUE 'M'.
   88 MALE         VALUE 'M'.
   88 FEMALE       VALUE 'F'.

The declaration below initializes the WS-GENDER with 'M', which sets the MALE condition name to true.

What is the different formats in defining condition names?

Condition name has the advantage of being used in three different formats, which are very useful in validating the data. Those are -

  • Condition names with Single Value
  • Condition names with Multiple values
  • Condition names with Range of values

Frequently Asked Questions -

What is the significance of level numbers in COBOL?

What is 01 to 49 level number in COBOL?

What are 66 and 88 level used for?
When do you use 66 and 88 levels in COBOL?
What are level 66 and level 88 in the COBOL programming language?

What are levels 66, 77 and 88 used for?
What are the uses of 66, 77 and 88 levels?

Define the function of using the special level number 88 in programming?
What is the major role of using the special variable number 88 in COBOL?