COBOL Multiple Choice Questions and Answers

12/23/2009 No Comment

COBOL MCQ and Answers.

Mainframe COBOL Technical Test Questions.

CICS Interview QuestionsJCL Interview Questions
DB2 Interview QuestionsCOBOL Interview Questions
VSAM Interview QuestionsIDMS Interview Questions
IMS Interview QuestionsMVS Interview Questions

1) The following statement WRITE OUT-REC.
Which one of the following modes of operating the Sequential file is not true

(a) OPEN INPUT
(b) OPEN OUTPUT
(c) OPEN EXTEND
(d) OPEN INPUT-OUTPUT
Answer: A

2) The same file name can be specified in the USING and GIVING phrase of a SORT statement.(1) True
(2) False

Answer: 1

3) If USING is specified in the SORT verb, then GIVING must also be specified.

(1) True
(2) False
Answer: 2


4) In SORT statement, all keys must be specified as ascending or descending but not as combination of the two

(1) True
(2) False

Answer: 2

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.

(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.
Answer: 2


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.
(4) The sizes of the records described for STUDENT-FILE , INPUT-FILE and OUTPUT-FILE must be equal.

Answer: 3

7) About the MERGE verb,which one of the following is true.
(1) Can merge a maximum of three files.
(2) Does not require that the input file to be merged be sorted on the merge keys.
(3) Requires that all files mentioned in the statement must have records of same size.
(4) Does not require that the position of the merge keys with in the records descriptions of each of the files must be same.

Answer: 3

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
(4) INPUT PROCEDURE ….. OUTPUT PROCEDURE

Answer: 3

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
(2) WRITE STATEMENT
(3) START STATEMENT
Answer: 1


10) WRITE MASTER-REC INVALID KEY GO TO PARA-ERROR.
Indicate which of the following are not valid modes of opening the INDEXED file of which MASTER-REC is a record
(a) OPEN INPUT (b) OPEN OUTPUT (c) OPEN INPUT-OUTPUT (d) OPEN INDEXED.
(1) a and b
(2) a and c
(3) c and d
(4) a and d 

Answer: 4

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
(4) As in the case of SORT statement, the file must be closed before the use of this statement
Answer: 3


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

Answer: 

13) Indicate which of the following is not a PROCEDURE DIVISION verb

(1) START
(2) SEEK
(3) RERUN
(4) DELETE

Answer: 

14) Indicate which of the following is not a PROCEDURE DIVISION verb

(1) REWRITE
(2) INSERT
(3) DELETE
(4) START
Answer: 2


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

Answer: 

16) In case of a disk file, the ACCESS MODE clause must always be specified

(1) True
(2) False 

Answer: 2

17) A READ statement can have AT END clause and INVALID KEY clause, but both must not appear simultaneously.
(1) True
(2) False
Answer: 1


18) With a READ statement either AT END clause or INVALID KEY clause must be specified

(1) Yes
(2) No 

Answer: 2

19) Relative key clause must be mentioned in case of a Relative file organisation.

(1) Yes
(2) No

Answer: 2

20) The START statement enables the programmers to start processing from any record position.
(1) True
(2) False

Answer: 1

21) Both the RECORD KEY and ALTERNATIVE KEY clause can be specified for and INDEXED file.

(1) True
(2) False

Answer: 1

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.
(4) The EXAMINE statement is incorrect as TALLYING OPTION is missing.

Answer: 3

23) The UNSTRING verb is used to transfer data from several sources to one receiving field.\

(1) Yes
(2) No 

Answer: 2

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
(2) True

Answer: 1

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

Answer: 2

26) The INSPECT statement can be used to check whether the value in a data name is numeric

(1) True
(2 False 

Answer: 2

27) In an UNSTRING statement a receiving field receives the characters of the sending field including the delimiter.

(1) True
(2) False 

Answer: 2

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 

Answer: 2

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 

Answer: 2

30) 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.
Answer: 2


31) Indicate in which of the following, the REPORT NAME does not appear
(1) RD entry
(2) INITIATE statement
(3) SELECT clause
(4) TERMINATE statement

Answer: 3

32) Which of the following Report groups must have a data name for its identification.\

(1) REPORT HEADING
(2) REPORT FOOTING
(3) DETAIL
(4) PAGE HEADING
Answer:  3


33) Indicate which of the following clause is not allowed in a RD entry
(1) FIRST DETAIL
(2) LAST DETAIL
(3) CONTROLS
(4) LINE NUMBER

Answer: 4

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
(3) VALUE
(4) GENERATE
Answer: 2


35) Which of the following is not allowed to assign a value to a data name in a REPORT SECTION.
(1) MOVE
(2) TOTAL
(3) SUM
(4) SOURCE

Answer: 2

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 

Answer: 2

37) Identify the incorrect statement

(1) CALL RAF-SUB.
(2) CALL RAF-SUB ON OVER FLOW GO TO MIS-SUB.
(3) CALL RAF-SUB USING PARAM-1.
(4) CALL RAF-SUB USING PARAM-1 UNTIL PARAM-1 >10 

Answer: 4
Related Posts


No comments :

 

Aired | The content is copyrighted and may not be reproduced on other websites. | Copyright © 2009-2016 | All Rights Reserved 2016

Contact Us | About Us | Privacy Policy and Disclaimer