COBOL Online Quiz


Advertisements


Following quiz provides Multiple Choice Questions (MCQs) related to COBOL Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - What is 77 level used for?

A - Renames

B - Redefine

C - Group Item

D - Elementary Level

Answer : D

Explanation

77 level is an elementary level item which cannot be subdivided.

Q 2 - Under which section we should make an entry in the program for a SORT file?

A - FD

B - SD

C - MD

D - None of these

Answer : B

Explanation

For sorting a file, we should make an SD entry in File Section.

Q 3 - What is the position of Area A in COBOL program?

A - 1-6 Columns

B - 8-11 Columns

C - 12-72 Columns

D - 72-80 Columns

Answer : B

Explanation

Area A starts from 8 to 11 column. All COBOL divisions, sections, paragraphs and some special entries must begin in Area A.

Q 4 - Moving a Alphabetic field to Alphanumeric is legal?

A - Yes

B - No

Answer : A

Explanation

Moving a alphabetic field to alphanumeric is legal in COBOL.

Q 5 - What is the output of following program?

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.

DATA DIVISION.
   WORKING-STORAGE SECTION.
   01 WS-DESCRIPTION.
   05 WS-DATE1 VALUE '20140831'.
   10 WS-YEAR PIC X(4).
   10 WS-MONTH PIC X(2).
   10 WS-DATE PIC X(2).
   05 WS-DATE2 REDEFINES WS-DATE1 PIC 9(8).

PROCEDURE DIVISION.
   DISPLAY WS-DATE2.

STOP RUN.

A - 00000000

B - 20140831

C - Compilation error

D - Run time error

Answer : B

Explanation

When we redefine WS-DATE1 to WS-DATE2, automatically values from WS-DATE1 will be moved to WS-DATE2.

You can try same code using Try it option available below:

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.

DATA DIVISION.
   WORKING-STORAGE SECTION.
   01 WS-DESCRIPTION.
   05 WS-DATE1 VALUE '20140831'.
   10 WS-YEAR PIC X(4).
   10 WS-MONTH PIC X(2).
   10 WS-DATE PIC X(2).
   05 WS-DATE2 REDEFINES WS-DATE1 PIC 9(8).

PROCEDURE DIVISION.
   DISPLAY WS-DATE2.

STOP RUN.

Q 6 - With test before is the default condition and it indicates that the condition is checked before the execution of statements in a paragraph. Is this statement true or false?

A - False

B - True

Answer : B

Explanation

This statement is true as with test before is the default condition for Perform until statement.

Q 7 - Static Call occurs when a program is compiled with the NODYNAM compiler option. A static called program is loaded into storage at compile time. Is this statement true or false.

A - False

B - True

Answer : B

Explanation

This statement is correct.

Q 8 - Dynamic Call occurs when a program is compiled with the DYNAM and NODLL compiler option. A dynamic called program is loaded into storage at runtime. Is this statement true or false?

A - False

B - True

Answer : B

Explanation

This statement is correct.

Answer : C

Explanation

In Data Division we declare all the working storage variables.

Q 10 - What is the length of PIC S9(7)V99 COMP-3?

A - 10

B - 9

C - 4

D - 5

Answer : D

Explanation

(9+1)/2 = 5 bytes.


cobol_questions_answers.htm

Advertisements