Showing posts with label COBOL Multiple Choice Questions. Show all posts
Showing posts with label COBOL Multiple Choice Questions. Show all posts

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

(a)Yes
(b)No

Answer: b

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

(a)The EXAMINE statement is incorrect because A does not contain the character “ABC” in a continuous sequence
(b)The EXAMINE statement is incorrect as it can be used to replace a numeric literal by another numeric literal.
(c)The EXAMINE statement is incorrect as it is used to replace a single character by another single character but not a group of characters.
(d)The EXAMINE statement is incorrect as TALLYING OPTION is missing.

Answer: c

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

(a)True
(b)False

Answer: a

The START statement enables the programmers to start processing from any record position.

(a)True
(b)False

Answer: a

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

(a)Yes
(b)No

Answer: b


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

(a)Yes
(b)No

Answer: b

A READ statement can have AT END clause and INVALID KEY clause, but both must not appear simultaneously.

(a)True
(b)False

Answer: a

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

(a)True
(b)False

Answer: b

Indicate which of the following is not a PROCEDURE DIVISION verb

(a)REWRITE
(b)INSERT
(c)DELETE
(d)START

Answer: b

Which of the following is true about the file which is referenced in a DELETE statement

(a)It must be opened in INPUT mode
(b)It must be opened in OUTPUT mode
(c)It must be opened in I-O mode
(d)As in the case of SORT statement, the file must be closed before the use of this statement

Answer: c

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.
(a)a and b
(b)a and c
(c)c and d
(d)a and d

Answer: d

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.

(a)REWRITE STATEMENT
(b)WRITE STATEMENT
(c)START STATEMENT

Answer: a

Indicate which one the following is not a valid combination of a SORT verb

(a)USING …….. GIVING
(b)USING …….. INPUT PROCEDURE
(c)USING …….. OUTPUT PROCEDURE
(d)INPUT PROCEDURE ….. OUTPUT PROCEDURE

Answer: c

About the MERGE verb,which one of the following is true.

(a)Can merge a maximum of three files.
(b)Does not require that the input file to be merged be sorted on the merge keys.
(c)Requires that all files mentioned in the statement must have records of same size
(d)Does not require that the position of the merge keys with in the records descriptions of each of the files must be same.

Answer: c

SORT STUDENT-FILE ON ASCENDING KEY CLASS-NUMBER STUDENT-NAME USING INPUT-FILE GIVING OUTPUT-FILE. Which one of the following is false.

(a)All records with same CLASS-NUMBER will appear together in the consecutive positions of the sorted file.
(b)The data-names CLASS-NUMBER and STUDENT-NAME must appear in the record description of STUDENT-FILE.
(c)The files INPUT-FILE and OUTPUT-FILE should be opened by an OPEN statement before the SORT statement.
(d)The sizes of the records described for STUDENT-FILE , INPUT-FILE and OUTPUT-FILE must be equal.

Answer: c

SORT RAFFLES_FILE ON ASCENDING KEY IBM-MAIN Y2K-MAIN USING INPUT-FILE GIVING OUTPUT-FILE. Which one the following is true.

(a)The sorted file will contain all Raffles records in ascending order of Y2K-MAIN.
(b)IBM-MAIN is the major key and Y2K-MAIN is the minor key
(c)The statement is wrong as there should be only one key since the clause ascending key appears only once.
(d)Both INPUT-FILE and OUTPUT-FILE must be described in the DATA DIVISION with SD entries.

Answer: b

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

(a)True
(b)False

Answer: b


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

(a)True
(b)False

Answer: b

The same file name can be specified in the USING and GIVING phrase of a SORT statement.

(a)True
(b)False

Answer: a


Which one of the following modes of operating the Sequential file is not true

(a) OPEN INPUT
(b) OPEN INPUT-OUTPUT
(c) OPEN EXTEND
(d) OPEN OUTPUT

Answer: a