Multiple choice technology programming languages

" UNSTRING “ABC” INTO FIELD-1. Indicate which one of the following is correct. " " UNSTRING “ABC” INTO FIELD-1. Indicate which one of the following is correct. "

  1. There will be a syntax error, as the statement does not contain any DELIMITED BY phrase.

  2. There will be a syntax error, as the sending string must be identifier and not a literal.

  3. The statement is correct and after the execution of the statement field-1 will contain the three characters “ABC” from the left-most position and the remaining positions of field-1 will remain unchanged

  4. The statement is correct and after the execution of the statement field-1 will contain the three characters “ABC” from the left-most position and the remaining positions of field-1 will get filled with spaces

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

In COBOL, the UNSTRING statement requires the sending field to be a data identifier (variable name), not a literal. The syntax UNSTRING "ABC" is invalid because literals cannot be used directly. Option A is incorrect because DELIMITED BY is optional for simple unstringing. Options C and D are incorrect because the statement will not execute due to the syntax error.