Tag: mainframe

Questions Related to mainframe

"MAKEBUF" Push ‘TCS’ Push ‘TATA’ Push ‘CONSULTANCY’ Push ‘SERVICES’ "QELEM" "DROPBUF" "QELEM" What will be returned by "QELEM" in step 6 and 8 ?

  1. 4,4

  2. 4,0

  3. 3,3

  4. 3,0


Correct Option: B
  1. Will contain zeroes if numeric and spaces if alphabetic or alphanumeric

  2. Will contain spaces for all variables

  3. Will contain an undefined value

  4. None of the above


Correct Option: C

What is a 66 level in COBOL used for?

  1. Elementary level item

  2. Condition names

  3. Initialize

  4. Renames


Correct Option: D
  1. Elementary level item

  2. For condition names

  3. Initialize

  4. Renames


Correct Option: A

Is this variable definition correct?

  1. True

  2. False


Correct Option: B
  1. The file will be created and will be opened for reading and writing

  2. The open fails and error occurs

  3. File will be created and opened for writing only

  4. The file will be created and opened for reading only


Correct Option: B

What is an 88 level used for in COBOL?

  1. Elementary level

  2. For condition names

  3. Initialize

  4. Renames


Correct Option: B

AI Explanation

To answer this question, you need to understand the structure and syntax of COBOL programming language.

In COBOL, the level number is used to define the level of a data item. The level number indicates the hierarchy or nesting level of the data item within the program's data structure.

The correct answer is B) For condition names.

In COBOL, level 88 is used to define condition names. Condition names are used to represent conditions or states in the program. They are typically used in conjunction with the "IF" statement to test for a specific condition and execute certain logic based on the result.

For example, let's say you have a condition name called "INVALID-AGE" defined at the 88 level. You can then use this condition name in an "IF" statement to test if the age entered is invalid:

01 AGE PIC 9(2).
88 INVALID-AGE VALUE 0 THRU 17.

IF AGE IS INVALID-AGE
  DISPLAY "Invalid age entered."
ELSE
  DISPLAY "Valid age entered."
END-IF.

In this example, if the age entered is between 0 and 17 (inclusive), the condition "INVALID-AGE" will be true, and the message "Invalid age entered." will be displayed. Otherwise, the message "Valid age entered." will be displayed.

Therefore, the correct answer is B) For condition names.

What happens when the access mode of an indexed file is DYNAMIC?

  1. The records will be accessed one after the other in order of primary key

  2. The file will be accessed one record at a time and for each access an exact value for the primary key will be specified

  3. Both 1 and 2

  4. None of the above


Correct Option: C

What is the number of characters in COBOL-85 character set?

  1. 51

  2. 52

  3. 53

  4. 54


Correct Option: B