Multiple choice technology programming languages

"77 A PIC X(10) VALUE IS “AABBCCDDEE”.In PROCEDURE DIVISION contains the statement EXAMINE A REPLACING ALL “ABC” BY “XYZ” .Indicate which one of the following is true "

  1. The EXAMINE statement is incorrect because A does not contain the character “ABC” in a continuous sequence

  2. The EXAMINE statement is incorrect as it can be used to replace a numeric literal by another numeric literal.

  3. The EXAMINE statement is incorrect as it is used to replace a single character by another single character but not a group of characters.

  4. The EXAMINE statement is incorrect as TALLYING OPTION is missing.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The EXAMINE statement in COBOL is designed to replace or count single characters (literals of length 1) within a data item. It cannot be used to replace a multi-character string like 'ABC' with another multi-character string like 'XYZ'. For multi-character string manipulations, the INSPECT statement must be used instead.