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.
Q 1 - Which data type is not available in COBOL?
A - Alphabetic (A) 
B - Long (L)
C - Alphanumeric (X) 
D - Numeric (9) 
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 
C - Common Oriented Business Language 
D - Common Object Business Language 
 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?
A - PROCEDURE DIVISION. 
B - IDENTIFICATION DIVISION 
C - DATA DIVISION 
D - ENVIRONMENT DIVISION 
 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? 
A -  First Bit
B -  Last Bit
C -  First Nibble
D -  Last Nibble
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.
C -  Program will execute normally.
D -  Program will throw compilation error.
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? 
A -  APPEND
B -  INPUT
C -  OUTPUT
D -  EXTEND
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?
A -  9(20)
B -  9(18)
C -  9(31)
D -  9(10)
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?
A -  OUTPUT
B -  EXTEND
C -  Either OUTPUT or EXTEND
D -  INPUT-OUTPUT
To write into a file, the file has to be opened in either OUTPUT or EXTEND mode.
Q 9 - What is 77 level used for?
A -  Renames
B -  Redefine
C -  Group Item
D -  Elementary Level
77 level is an elementary level item which cannot be subdivided.
Q 10 - Where does AREA B in COBOL start from?
A - 01 to 07 columns 
B - 12 to 72 columns 
C - 08 to 11 columns 
D - 73 to 80 columns 
All COBOL statements must begin in area B which starts from 12 to 72 columns  
Q 11 - Where does the FILE-CONTROL paragraph appear?
A - Procedure Division
B - Environment Division
C - Identification Division
D - Data Division 
 FILE-CONTROL paragraph appears in the Input-Ouput Section in the Environment Division which provides information of external data sets used in the program.
Q 12 - Can I redefine an X(10) field with a field of X(20)?
A - No
B - Yes
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.
Q 13 - What is the length of PIC 9.999?
A - 4
B - 6
C - 5
D - 3
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.
A - 11
B - 5
C - 10
D - 15
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.
Q 15 - Which cobol verb is used for updating a file?
A - READ
B - WRITE
C - UPDATE
D - REWRITE
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?
A - FD
B - SD
C - MD
D - None of these
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?
A - S9(8) COMP
B - S9(4) COMP
C - 9(8) COMP
D - 9(4) COMP
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?
A - .00436
B - 00436
C - 436
D - 43600
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?
A - Elementary Item
B - Group Item
C - Both A & B
D -  None of these
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?
A - IKJEFT01
B - IGYCRCTL
C - IGYCTCRL
D - None of these
IGCRCTL utility is used to compile a COBOL program.
Q 21 - How many bytes does a S9(7) SIGN TRAILING SEPARATE field occupy?
A - 7 bytes
B - 8 bytes
C - 4 bytes
D - 10 bytes
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? 
A - Linear search 
B - Binary search
C - Sequential search
D - None of these 
Search All is a binary search method, which is used to find elements inside the table.
Q 23 - In which division, Linkage Section comes?
A - Identification Division
B - Environment Division
C - Data Division
D - Procedure Division
Linkage section comes under data division which is used in called program.
Q 24 - In which division, Input-Output section?
A - Identification Division
B - Environment Division
C - Data Division
D - Procedure Division
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? 
A - TutorialsPoint(1:9)
B - TutorialsPoint(9)
C - TutorialsPoint(9:1)
D - TutorialsPoint(9:9)
In STRING(A,B), A is the staring position and B id the number of digits to select.

    12 Lectures 
     2.5 hours 

 Nishant Malik

    33 Lectures 
     3.5 hours 

 Craig Kenneth Kaercher
 Print
 Add Notes
 Bookmark this page