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?
Long data type is not available in COBOL. COBOL supports three data types Alphabetic, Numeric & Alphanumeric.
Q 2 - What does COBOL stand for?
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?
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?
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 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?
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?
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?
To write into a file, the file has to be opened in either OUTPUT or EXTEND mode.
77 level is an elementary level item which cannot be subdivided.
Q 10 - Where does AREA B in COBOL start from?
All COBOL statements must begin in area B which starts from 12 to 72 columns
Q 11 - Where does the FILE-CONTROL paragraph appear?
FILE-CONTROL paragraph appears in the Input-Ouput Section in the Environment Division which provides information of external data sets used in the program.
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.
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.
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.
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?
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?
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?
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?
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?
IGCRCTL utility is used to compile a COBOL program.
Q 21 - How many bytes does a S9(7) SIGN TRAILING SEPARATE field occupy?
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?
Search All is a binary search method, which is used to find elements inside the table.
Q 23 - In which division, Linkage Section comes?
Linkage section comes under data division which is used in called program.
Q 24 - In which division, Input-Output section?
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?
In STRING(A,B), A is the staring position and B id the number of digits to select.
|Question Number||Answer Key|