- COBOL Tutorial
- COBOL - Home
- COBOL - Overview
- COBOL - Environment Setup
- COBOL - Program Structure
- COBOL - Basic Syntax
- COBOL - Data Types
- COBOL - Basic Verbs
- COBOL - Data Layout
- COBOL - Conditional Statements
- COBOL - Loop Statements
- COBOL - String Handling
- COBOL - Table Processing
- COBOL - File Handling
- COBOL - File Organization
- COBOL - File Access Mode
- COBOL - File Handling Verbs
- COBOL - Subroutines
- COBOL - Internal Sort
- COBOL - Database Interface
- COBOL Useful Resources
- COBOL - Questions and Answers
- COBOL - Quick Guide
- COBOL - Useful Resources
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
COBOL Mock Test
This section presents you various set of Mock Tests related to COBOL Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
COBOL Mock Test I
Q 1 - Which data type is not available in COBOL?
Answer : B
Explanation
Long data type is not available in COBOL. COBOL supports three data types Alphabetic, Numeric & Alphanumeric.
Q 2 - What does COBOL stand for?
A - Common Business Oriented Language
B - Common Business Object Language
Answer : A
Explanation
COBOL stands for COmmon Business Oriented Language which was developed to automate the business process.
Q 3 - Which is the mandatory division in COBOL program?
Answer : B
Explanation
Identification division contains entries that is used to identify the program. This is the the first division and only mandatory division.
Q 4 - How is sign stored in a COMP-3 field?
Answer : D
Explanation
In COMP-3 field, sign is stored in last nibble.
Q 5 - What will happen if you code GO BACK instead of STOP RUN in a stand alone COBOL program?
A - Program will give run time error.
B - Program will go in infinite loop.
Answer : B
Explanation
A Stop run ends the unit of work and returns control to the operating system whereas GOBACK returns control to calling program. So if we code GO BACK instead of Stop Run, it will go in infinite loop.
Q 6 - Which of the following file opening mode is invalid in COBOL?
Answer : A
Explanation
Valid file opening modes in COBOL are INPUT, OUTPUT, I-O, and EXTEND. APPEND file mode is not available in COBOL.
Q 7 - What is the maximum size of a numeric field we can define in COBOL?
Answer : B
Explanation
COBOL applications use 31 digit numeric fields. However, compiler only supports a maximum of 18 digits. So we use a maximum of 18 digits.
Q 8 - What is the mode in which you will OPEN a file for writing?
Answer : C
Explanation
To write into a file, the file has to be opened in either OUTPUT or EXTEND mode.
Answer : D
Explanation
77 level is an elementary level item which cannot be subdivided.
Q 10 - Where does AREA B in COBOL start from?
Answer : B
Explanation
All COBOL statements must begin in area B which starts from 12 to 72 columns
Q 11 - Where does the FILE-CONTROL paragraph appear?
Answer : B
Explanation
FILE-CONTROL paragraph appears in the Input-Ouput Section in the Environment Division which provides information of external data sets used in the program.
Answer : B
Explanation
Yes we can define a X(10) to X(20) as Redefines causes both fields to start at the same location, but it is not a good coding practice.
Answer : C
Explanation
Length of PIC 9.999 is 5 as '.' takes 1 byte. So total 1 byte for '.' and 4 bytes for 9.
Q 14 - How many times following loop will execute?
MOVE 5 TO X. PERFORM X TIMES. MOVE 10 TO X. END-PERFORM.
Answer : B
Explanation
PERFORM loop will execute for 5 times. As it reads the first statement PERFORM 5 times. It replaces X with the value 5.
You can try same code using Try it option available below:
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 99. PROCEDURE DIVISION. MOVE 5 TO X. PERFORM X TIMES MOVE 10 TO X DISPLAY 'COUNT' END-PERFORM. STOP RUN.
Answer : D
Explanation
Rewrite verb is used to update the records. File should be opened in I-O mode for rewrite operations. It can be used only after a successful Read operation. Rewrite verb overwrites the last record read.
Q 16 - Under which section we should make an entry in the program for a SORT file?
Answer : B
Explanation
For sorting a file, we should make an SD entry in File Section.
Q 17 - How you will declare a Half Word Binary in program?
Answer : B
Explanation
S9(4) COMP is used to declare a Half Word Binary.
Q 18 - If 436 value is moved to a PP999 PIC clause, then what is edited value taken?
Answer : A
Explanation
P is assumed decimal scaling position which is used to specify the location of an assumed decimal point when the point is not within the number that appears in the data item. .PIC PP999 means that numeric data item is of 3 characters and there are 5 positions after the decimal point.
Q 19 - Where can we specify OCCURS clause?
Answer : C
Explanation
In array declaration, we can specify occurs clause on Elementary item as well as on Group item also.
Q 20 - Which utility is used for compiling COBOL program?
Answer : B
Explanation
IGCRCTL utility is used to compile a COBOL program.
Q 21 - How many bytes does a S9(7) SIGN TRAILING SEPARATE field occupy?
Answer : B
Explanation
9(7) will take 7 bytes and 1 byte for SIGN TRAILING SEPARATE, so total 8 bytes it will take.
Q 22 - What does SEARCH ALL do?
Answer : B
Explanation
Search All is a binary search method, which is used to find elements inside the table.
Q 23 - In which division, Linkage Section comes?
Answer : C
Explanation
Linkage section comes under data division which is used in called program.
Q 24 - In which division, Input-Output section?
Answer : B
Explanation
Input-Output section comes under Environment division which provides information about the files to be used in the program.
Q 25 - Which of the following statement will give you ‘Tutorials’ in TutorialsPoint string?
Answer : A
Explanation
In STRING(A,B), A is the staring position and B id the number of digits to select.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | B |
2 | A |
3 | B |
4 | D |
5 | B |
6 | A |
7 | B |
8 | C |
9 | D |
10 | B |
11 | B |
12 | B |
13 | C |
14 | B |
15 | D |
16 | B |
17 | B |
18 | A |
19 | C |
20 | B |
21 | B |
22 | B |
23 | C |
24 | B |
25 | A |