COBOL Multiple Choice Questions and Answers
COBOL Multiple Choice Questions and Answers
Overview: COBOL Multiple Choice Questions and Answers, Mainframe COBOL Technical Test
Questions, COBOL Technical Aptitude Test.
2) The same file name can be specified in the USING and GIVING phrase of a SORT statement.
(1) True (x)
(2) False
3) If USING is specified in the SORT verb, then GIVING must also be specified.
(1) True
(2) False (x)
4) In SORT statement, all keys must be specified as ascending or descending but not as
combination of the two
(1) True
(2) False (x)
5) SORT RAFFLES_FILE
ON ASCENDING KEY IBM-MAIN Y2K-MAIN
USING INPUT-FILE GIVING OUTPUT-FILE.
Which one the following is true.
(1) The sorted file will contain all Raffles records in ascending order of Y2K-MAIN.
(2) IBM-MAIN is the major key and Y2K-MAIN is the minor key (x)
(3) The statement is wrong as there should be only one key since the clause ascending key appears only
once.
(4) Both INPUT-FILE and OUTPUT-FILE must be described in the DATA DIVISION with SD entries.
6) SORT STUDENT-FILE
ON ASCENDING KEY CLASS-NUMBER STUDENT-NAME
USING INPUT-FILE GIVING OUTPUT-FILE.
Which one of the following is false.
(1) All records with same CLASS-NUMBER will appear together in the consecutive positions of the sorted
file.
(2) The data-names CLASS-NUMBER and STUDENT-NAME must appear in the record description of
STUDENT-FILE.
(3) The files INPUT-FILE and OUTPUT-FILE should be opened by an OPEN statement before the SORT
statement. (x)
(4) The sizes of the records described for STUDENT-FILE , INPUT-FILE and OUTPUT-FILE must be
equal.
8) Indicate which one the following is not a valid combination of a SORT verb
(1) USING …….. GIVING
(2) USING …….. INPUT PROCEDURE
(3) USING …….. OUTPUT PROCEDURE (x)
(4) INPUT PROCEDURE ….. OUTPUT PROCEDURE
9) Indicate which one of the following will not have the INVALID KEY Phrase when used in
connection with sequentially accessed relative file in a PROCEDURE DIVISION with out any
declarative section.
(1) REWRITE STATEMENT (x)
(2) WRITE STATEMENT
(3) START STATEMENT
11) which of the following is true about the file which is referenced in a DELETE statement
(1) It must be opened in INPUT mode
(2) It must be opened in OUTPUT mode
(3) It must be opened in I-O mode (x)
(4) As in the case of SORT statement, the file must be closed before the use of this statement
12) Indicate which of the following statement is not allowed when a relative file is opened to I-O
mode and the ACCESS mode is RANDOM
(1) READ
(2) WRITE
(3) REWRITE
(4) START
15) Indicate which of the statements may indicate DUPLICATE alternative key warning if it occurs
in case of an INDEXED ORGANISATION without DUPLICATE phrase (A) READ (B) REWRITE (C)
WRITE (D) DELETE (E) START
(1) A,D,E
(2) A,B,C
(3) A,C,D
(4) B,C,D
16) In case of a disk file, the ACCESS MODE clause must always be specified.
(1) True
(2) False (x)
17) A READ statement can have AT END clause and INVALID KEY clause, but both must not
appear simultaneously.
(1) True (x)
(2) False
18) With a READ statement either AT END clause or INVALID KEY clause must be specified
(1) Yes
(2) No (x)
19) Relative key clause must be mentioned in case of a Relative file organisation.
(1) Yes
(2) No (x)
20) The START statement enables the programmers to start processing from any record position.
(1) True (x)
(2) False
21) Both the RECORD KEY and ALTERNATIVE KEY clause can be specified for and INDEXED file.
(1) True (x)
(2) False
22) 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. (x)
(4) The EXAMINE statement is incorrect as TALLYING OPTION is missing.
23) The UNSTRING verb is used to transfer data from several sources to one receiving field.
(1) Yes
(2) No (x)
24) The STRING verb can be used to tranfer characters from one alphanumeric field to another
alphanumeric field starting at some particular position in receiving field
(1) False (x)
(2) True
25) If the DELIMITED BY SIZE phrase is used with STRING verb, the transfer of characters in to the
receiving field stops as soon as a blank is encountered in the sending field
(1) Yes
(2) No (x)
26) The INSPECT statement can be used to check whether the value in a data name is numeric
(1 True
(2 False (x)
27) In an UNSTRING statement a receiving field receives the characters of the sending field
including the delimiter.
(1) True
(2) False (x)
28) If the OVER FLOW option is not used in a STRING statement and the overflow condition
occurs, the STRING operation is terminated.
(1) True
(2) False (x)
29) In an UNSTRING statement if a receiving field with PICTURE X(06) receives only two
characters from the sending field the remaining four positions will retain their original characters
(1) True
(2) False (x)
31) Indicate in which of the following, the REPORT NAME does not appear
(1) RD entry
(2) INITIATE statement
(3) SELECT clause (x)
(4) TERMINATE statement
32) Which of the following Report groups must have a data name for its identification.
(1) REPORT HEADING
(2) REPORT FOOTING
(3) DETAIL (x)
(4) PAGE HEADING
(48) CONTROL FOOTING
34) Indicate which of the following, performs the initialization of the sum controls, LINE-COUNTER
and PAGE-COUNTER to their initial values.
(1) RESET
(2) INITIATE (x)
(3) VALUE
(4) GENERATE
35) Which of the following is not allowed to assign a value to a data name in a REPORT SECTION.
(1) MOVE
(2) TOTAL (x)
(3) SUM
(4) SOURCE
36) A formal parameter name can appear more than once in the USING phrase of the PROCEDURE
DIVISION header of the subroutine
(1) True
(2) False (x)