0% found this document useful (0 votes)
1K views38 pages

Cobol Qustions

The document contains questions about COBOL programming concepts. It covers topics like file control, input-output sections, sequential file access, COBOL divisions, arithmetic operations, EVALUATE statements, and more. The questions are multiple choice with one correct answer for each.

Uploaded by

Maryam Asfour
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views38 pages

Cobol Qustions

The document contains questions about COBOL programming concepts. It covers topics like file control, input-output sections, sequential file access, COBOL divisions, arithmetic operations, EVALUATE statements, and more. The questions are multiple choice with one correct answer for each.

Uploaded by

Maryam Asfour
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 38

COBOL1.

1 :

1- The FILE CONTROL ( And I-O-CONTROL paragraph ) is a paragraph in

A) FILE SECTION
B) LINKAGE SECTION
C) WORKING STORAGE SECTION
D) INPUT-OUTPUT SECTION

2- The INPUT-OUTPUT SECTION is used to specify the file SELECT clause


A) TRUE
B) FALSE

3- In sequential file access, records can be Accessed sequentially using their


Relative Record Numbers
A) TRUE
B) FALSE

4- Which one of the following section does not belong to ENVIRONMENT


DIVISION IN COBOL ?
A) The Configuration Section
B) Working storage section
C) The input-output section
D) None of the above

5- Which of the following COBOL divisions contains machine dependent


details?
a) Identification Division
b) Environment Division
c) Data Division
d) Procedure division

6- The first division of Coble is


a) Environment division
b) Identification division
c) Data division
d) Procedure division

7- Which statement will logically remove records from indexed and relative
files only?
a) delete statement
b) inspect statement
c) accept statement
d) open statement

8- What Will happen if you code GO BACK instead of STOP RUN in a stand-
alone COBOL program i.e program which is not calling any other program
a) Infinite Loop Execution
b) Return-code 12 during compilation
c) Both gives same result
d) Soc4 during execution

9- Which one of the following is true?


a) EVALUATE TRUE
b) EVALUATE FALSE
c) EVALUATE <expression>
d) All the above

10- What are the ACCESS MODE available in COBOL for a sequential file?
a) SEQUENTIAL
b) RANDOM
c) DYNAMIC
d) All of the above

11- Give the Number of bytes for S9(7).


a) 7
b) 8
c) 4
d) None of the above

12- In a COBOL program if the data items have identical names, then which
statement can be used to move the data?
a) MOVE UNIQUE
b) MOVE CORRESPONDING
c) MOVE IDENTICAL
d) NONE OF THE ABOVE

13- Pick the correct order of precedence in Arithmetic operations in COBOL


1. Multiplication 2. Unary 3. Addition. 4.
Exponentiation
a) Correct order = (1, 2, 4, 3)
b) Correct order = (2, 4, 1, 3 ) (Unary-Exponentiation-Multiplication-Addition)
c) Correct order = (2, 4, 3, 1)
d) Correct order = (2, 1, 4, 3)

14- A Paragraph PARA-x is to be executed when none of the data names A, B


and C have value of 1. Which of the following will achieve this?
a) IF A Not = 1 or B Not = 1 Or C not =1 PERFORM PARA-X
b) IF NOT = 1 AND B = 1 AND C = 1 PERFORM PARA-X
c) IF A NOT – 1 IF NOT B = 1 OR C= 1PERFORM PARA-X
d) IF A NOT = 1 AND B NOT = 1 AND C NOT = 1 PERFORM PARA-
X

15- IN which area the level indicator or level-number (01 and 77) should be
coded in COBOL program?
A) AREA A
B) AREA B
C) AREA C
D) Any of the above

16- How many characters are allowed in COBOL for defining a PARA/SECTION
name?
A) 24 Characters
B) 30 Characters
C) 32 Characters
D) 128 Characters

17- Which provides a shorthand notation for a series of nested IF statements.


A) EVALUATE statement
B) DISPLAY statement
C) ACCEPT statement
D) OPEN statement

18- Which clause allows the same area of memory to be referenced by more
than one data-name with different format and sizes?
A) RENAMES CLAUSE
B) REDEFINES CLAUSE
C) PICTURE CLAUSE
D) EXTERNAL CLAUSE

19- WPRLOMG-STPRAGE SECTION

77 A PIC 9 VALUE IS 1.

PROCEDURE DIVISION.

EVALUATE TRUE

WHEN A = 1

DISPLAY "CASE1"

WHEN OTHER

DISPLAY 'OTHER"

END-EVALUATE

What will be the output of the above EVALUATE statement ?

a) CASE2
b) CASE1
c) OTHER
d) NONE

COBOL 1.1
1- VS-COBOL – 2 is structured language
A) TRUE ?????
B) FALSE
2- ……………………… does not cause any data to be erased
A) Noerase
B) Redefines
C) Nodelete
D) Repeats

3- The COPY statement is a library statement that places


prewritten text/code in COBOL program.
A) TRUE
B) FALSE

4- What is the date format of CURRENT-DATE ?


A) YYYYMMDD
B) DDMMYYYY
C) MMDDYYYY
D) YYYYDDD

5- Function to convert lower case to upper case


A) FUNCTION UPPER-CASE
B) FUNCTION CHANGE-CASE UPPER
C) FUNCTION CASE-UPPER
D) FUNCTION U-C

6- 9(10) COMP uses


A) Half word
B) Full word
C) Double word
D) None of the above
1 through 4
2 bytes (halfword)

5 through 9
4 bytes (fullword)

10 through 18
8 bytes (doubleword)

7- What dose mean of FD entry ?


A) The record details of files are defined in FILE
DEFINITION entry
B) The record details of files are defined in FILE DETAILS
ENTRY
C) The record layout of files are defined in FILE
DESCRIPTION entry
D) All of the above

8- What is the purpose of the Environment Division?


A) Identify the source and object computers
B) Connect the filenames used in the program to the files
that exist in the mainframe data sets
C) Identify the program and programmer
D) Both a and b

9- A Cobol file record can be either an elementary item or a


group item.
A) TRUE
B) FALSE

10- Which statement takes the control to the next statement in


the paragraph after a logical/implicit end ?
A) RETURN
B) NEXT SENTENCE
C) CONTINUE
D) None of the above

11- Internal data are declared in


A) FILE SECTION
B) LINKAGE SECTION
C) WORKING STORAGE SECTION
D) Both A and B

12- RECORDING MODE U MEANS


A) Uniform records
B) Undefined records
C) Unique records
D) Unauthorized records

13- Which Cobol Statement reads the data from the run JCL to
the COBOL program ( while executing the program ).
A) GET
B) ACCEPT
C) SYSIN ??????
D) None of the above
14- The OCCURS clause cannot be specified in a data description
entry that has a level number of ?
A) 01, 66, 77, 88
B) 05, 10, 15, 20
C) 10, 15, 20, 25
D) 25, 20, 25, 30
15- Which statement you can use to control looping with a
definite number or with a decision ?
A) LOOP
B) EVALUATE
C) WHILE
D) PERFORM
COBOl L1 :

1- Which one of the below is a compulsory paragraph in Identification division


of Cobol
A) AUTHOR
B) INSTALLATION
C) PROGRAM-ID
D) A AND C

2- Which one of the following uses the value of occurrence in case of arrays ?
A) DISP
B) BINARY
C) INDEX
D) SUBSCRIPT

3- Which statement is used to count and replace data items ?


A) INSPECT STATEMENT
B) OPEN STATEMENT
C) ACCEPT STATEMENT
D) START STATEMENT

4- Consider the following code.


05 WS-VAR1 PIC X(5)
05 WS-VAR2 REDEFINES WA-VAR1 PIC 9(5)

PROCEDURE DIVISION.
MOVE 'ABCDE' TO WS-VAR1.

What is the value of WS-VAR1 and WS-VAR2 ?


A) Both variables will have the same value 'ABCDE'
B) SOC7 Sine WS-VAR2 variable defined as numeric clause
C) WS-VAR2 variable will have some JUNK value
D) Compilation error

5- Which one is not the division of COBOL ?


A) DATA DIVISION
B) STORAGE DIVISION
C) IDENTIFICATION DIVISIO
D) PROCEDURE DIVISION

6- Which of the following is not a valid COBOL verb ?


A) READ
B) ADD
C) UNWRITE
D) REWRITE

7- A Cobol Sentence
A) Collection of PARAGRAPHS
B) Collection of SECTIONS
C) Collection of DIVISIONS
D) Collection of statements

8- Which perform binary search in a table ?


A) SEARCH ALL
B) SEARCH
C) SEQ SEARCH
D) BINARY SEARCH

9- Consider the following COBOL statements.


01 WS-TABLE
03 WS-TABLE-EL OCCURS 5 TIMES PIC X(1) VALUE 'A'
03 WS-EX PEDEFINES WS-TABLE PIC X(5)


PROCEDURE DIVISION
DISPLAY WS-EX

A) AAAAA
B) A
C) Cannot redefine a table directly
D) None

10- Order of the program structure in COBOL is


A) Divisions Sections Paragraphs Sentences
B) Divisions-Paragraphs sections sentences
C) Divisions-Statements paragraphs Sections
D) Paragraphs Sentences- Statements- Sections

11- To give a data field an initial value of blanks, you could use
A) VALUE 'SPACES'
B) VALUE SPACES??????
C) VALUE INTIALIZE
D) VALUE BLANKS

12- Special-names paragraph appears in which of these section ?


A) Environment division and Configuration section
B) Data Division and Working-Storage Section
C) Environment division and Working-Storage Section
D) Data Division and Configuration Section

13- Which one of the following if NOT a PROCEDURE DIVISION verb ?


A) ADD
B) SUBTRACT
C) REDEFINES
D) DELETE

14- Multiple redefinitions of the same storage area are permitted


A) True
B) False

15- The data-name LINE-1 has following FILE section entry 05 LINE-1 PIC x(25)
The effect of the statement
MOVE SPACE TO LINE-1
Would be to
A) Move spaces to all the bytes of LINE-1
B) Move a single space to the first byte of LINE-1 leaving the others
unchanged
C) Move a single space to the last byte of LINE-1 leaving the others
unchanged
D) None of the above

16- Which of the following formats is invalid ?


A) ADD A, B GIVING C
B) ADD A TO B GIVING C
C) ADD A TO D
D) None of the above
17- ZEROES and SPACES are……………. Constants
A) Figurative
B) Numeric
C) Non-numeric
D) Alphabetic

18- CONTINUE will………………


A) Take the control to the sentence after it finds a full stop
B) Take the control to the next para
C) Take the control to the next verb
D) None

COBOL L1 :

1- Which of the below is compiler-directing statement


A) MOVE
B) COPY
C) ADD
D) SUBTRACT

2- What is 88 level used for ?


A) Elementary level item
B) Renames clause
C) Condition names
D) None of the above

3- The options available with SIGN clause


A) LEADING
B) TRAILING
C) SEPARATE
D) ALL OF THE ABOVE

4- A value clause can be specity for a Numeric edited PIC clause (PIC
ZZ9.99)
A) YES
B) NO

5- In which kind of file records can be appended and not inserted ?


A) Indexed file
B) Relative file
C) Random file
D) Sequential file

6- All the group items are alphanumeric


A) True
B) False
7- A level indicator used for a field must be in the range 01 to
A) 39
B) 40
C) 49
D) 50

8- Which of the following is true ?


A) Level 01 and Level 77 should start from area A
B) Level 77 can be declared in Area B
C) Level number 01 can start anywhere in Area A or B
D) None of the above

9- Where do we define the data names which are used in


PROCEDURE DIVISION ?
A) Identification Division only
B) Data division only
C) Procedure division only
D) None of the above

10- Which statement is used to chain together the partial or complete


contents of two or more data items or literal into one single data
item
A) JOIN
B) STRING
C) MOVE
D) INSPECT

11- After compiling. What is the resulting COBOL program referred to


as ?
A) Linked program
B) Executable program
C) Running program
D) Object program

Cobol

1) What are the mandatory divisions in a VS COBOL program?


a) Identification division & Environment division
b) Data division & Procedure division.
c) Identification division & Procedure division
d) No mandatory division. Ans( c) S
2)

What are the columns that belongs to Area A?


a) 8 to 18
b) 8 to 12
c) 8 to 16
d) 8 to 14 ans(b)- S

3) What are the steps for execution of a cobol program?


a) compiler
b) link-edit
c) compiler & link-edit
d) Exec Command ans( c)- S

4) What is the function of Input-Output Section in Cobol


programming?
a) specifies the characteristic of files to be used in the program
b) specifies the characteristic of data to be used in the program
c) specifies the characteristic of variable to be used in the program
d) specifies the characteristic of the processes to be used in the
program

ans( a)-M

5) What is the command used to transfer data between variables?


a) Move all
b) Move
c)Accept
d)examine ans(b)-S 6)

What is the level-no to be used for Renames clause?


a) Label-66
b) Label-77
c) Label-88
d) any label no ans( a)-S

7)What is the format that the data will be stored if ‘usage comp’ is
used?
a) Binary
b) Packed decimal
c) Hexa Decimal
d)All the above
ans(a) -M

8)When are COPY statements executed?


a) run time
b) compile time
c)execution time
d)All the above ans(b) -S

9)What is the default ‘usage’ clause in COBOL?


a) DISPLAY
b) COMP
c)COMP-1
d)COMP-3 ans(a) -S

10)With what errors are handled in arithmetic instructions?


a)ON ERROR
b)ON ERROR HANDLE
c)ON SIZE ERROR
d)None ans(c) -M

11)What is the verb used to get a remainder after doing a division


operation?
a) REMAINDER
b) DIVIDE WITH REMAINDER
c)DIVIDE
d)All the above ans(a) -S

12)In this what are the editing picture clauses?


a)Z
b)*
c)$
d)All the above ans(a)(c) -M

13) What is the output of the following code? MOVE 10 TO A.


MOVE 20 TO B. MOVE 30 TO C. IF (C > A) AND B)
DISPLAY “ C IS GREATEST’ ELSE DISPLAY “ C IS NOT
GREATEST” END-IF.

a) C IS GREATEST.
b) C IS NOT GREATEST
c) Error d)None ans(a) -M

14)What does CONTINUE in a iteration do?


a)Goes to the next iteration.
b)It contiues the execution.
c)It exits the program.
d)It does nothing. ans(d) -M

15)What is the output of the following code? EVALUATE A+B


WHEN 20 : DISPLAY “ ITS 20” WHEN 30 : DISPLAY “ITS 30”
WHEN 40 : DISPLAY “ITS 40” END-EVALUATE. When
the values of A is 10 , b is 10 , what is the output
a) ITS 20
b) ITS 30
c) ITS 40
d) None ans(a) -S

16)What are used when is needed to exit from the called program?
a) EXIT PROGRAM
b) GOBACK
c) STOP RUN
d) All the above ans(a) or (b) -C

17)How many divisions we can have in a table?


a)7
b)6
c)5
d)4 ans(a) -M

18)What is to be used for printing a report thru a cobol program ?


a)report
b)report writer
c)writer
d)all the above ans(b) -S

19)What verbs can be used to modify a index variable?


a)SET
b)PERFORM
c)MOVE
d)CHANGE ans(a)(b) -M

20)What kind of search is performed by SEARCH ALL ?


a)Linear search
b)binary
c)Segmented
d)Partioned ans(b) -S

21)How to change a value of a subscript?


a)by any cobol statements
b)MOVE
c)ADD
d)All the above ans(d) -C

22)What verb is used for creating dimensions in tables?


a)OCCURS
b)TABLE
c)TIMES
d)PERFORM ans(a) -S

23)What are the different organizations that cobol support for files?
a)Sequential
b)Indexed
c)Relative
d)Linear ans(a)(b)(c) -S

24)How many different record layouts can we have for a single file
a)any number
b)4
c)3
d)1 ans(a) -C

25)what is the error in the following code?

OPEN INPUT AFILE. READ AREC. DISPLAY AREC. CLOSE AFILE.

a)The record is not open.


b)The file is opened in INPUT mode.
c)The file is not closed properly.
d)The READ statement must have a file name. Ans(d) -C

26)What is the error in the following code?

FD AFILE RECORD CONTAINS 1 TO 10 CHARACTERS. O1 AREC.


05 EMPNO PIC 9(2). 05 EMPNAME PIC A(15). 05 EMPADDR
PIC A(10).

a)None
b)LABEL RECORDS ARE STANDARD is not specified.
c)The number sequence must be like 01 and 02.
d)The record size is mismatch. And(d) -C
27)What is the error in the following code? FD AFILE LABEL
RECORDS ARE OMITTED RECORD CONTAINS 1-50
CHARACTERS. 01 AREC. 02 EN PIC 9(2). 02
ENAME PIC A(15). 01 AREC1. 02 EN1 PIC 9(4).
02 ENAME1 PIC A(15).
01 AREC3. 02 EN PIC 9(5). 02 ENAME PIC A(12). 01
AREC4. 02 EN1 PIC 9(8). 02 ENAME1 PIC A(11).
a)It cannot have multiple record layouts.
b)It can have only one record layout.
c)The recordsize is mismatch.
d)No errors. ans(d) -C

28)What is the error in the following code?

01 GROUP1. 02 A PIC A(10). 02 B PIC A(15). 02 C


PIC A(20). 01 GROUP2 REDEFINES GROUP1. 05 A PIC A(10).
05 B PIC A(15). 05 C PIC A(20). 05 D PIC A(25).

a)No error
b)An extra member is specified in the newly redefined group.
c)the level numbers aren’t the same
d)The size doesn’t match. Ans(a) -C

29)What verb is used to add between members of a group?


a)ADD ALL
b)ADD CORR
c)ADD GROUP
d)None ans(b) -S

30)What is to be done for the following? If a float variable of type


99.99 has the 12.56 Is to be rounded to one decimal place ..
What are all to be done?
a)Create a variable of structure 99.9 and move the value to it.
b)Not possible
c)Give the rounded option
d)Change the value from 12.56 to 12.60. ans(a) -C

31)What is the maxiumum size of a variable name?


a)30
b)12
c)15 d)40 ans(a) -S

32)How many digits can numeric digit accomdate?


a)120
b)18
c)15
d)any number ans(b) -S

33) How many digits can alphabet accomdate?


a)120
b)180
c)150
d)any number ans(a) -M

34)What is section that is used while transferring datas between


programs?
a)LINKAGE SECTION
b)WORKING-STORAGE SECTION
c)SCREEN SECTION
d)user defined section is required ans(a) -S

35)What is the verb used to transfer values between programs?


a)USING
b)TRANSFER
c)THRU
d)CALL..USING ans(d) -C

36)How many programs can be linked with a single program?


a)any number
b)5
c)7
d)9 ans(a) -S

37)Can we have more than one single COBOL program inside a


member of a PDS. If yes , thru what the uniqueness is achieved?
a)no
b)impossible
c)yes .. member name
d)yes...program-id ans(d) -C

38)What is to be given and at what postion that to be given to make


a comment statement?
a)*,7
b)*,6
c)*,8
d)-,7 ans(a) -S
39)What is the default organization for a file in COBOL?
a)sequential
b)indexed
c)relative
d)None ans(a) -S

40)What is the place of connection between cobol programs and jcl


dd statements/
a)SELECT
b)no connection
c)INPUT-OUTPUT section
d)None ans(a) -M

41)Can we have a subprogram in the same member itself?


a)yes
b)no
c)impossible
d)may be ans(a) -M

42)How many STOP RUN statements a program can contain?


a)only one
b)two
c)three
d)any number ans(d) -M

43)Can we have both EXIT PROGRAM ang GOBACK in the same


subprogram?
a)yes
b)no
c)Impossible
d)can’t say ans(a) -C

44)Can we create a user-defined section in COBOL?


a)yes
b)no
c)Impossible
d)Can’t say ans(a) -M

45)In what columns the paragraph name can start in a COBOL


program/
a)8-12
b)12-15
c)2-72
d)none
ans(a) -M

46)What is the purpose of columns 73-80 in a COBOL screen?


a) comments
b) No usage
c) Printing
d) None ans(a) -M

47)What compiler program we use for compiling the COBO L


program?
a) IYWCL
b) IGYW
c) IGYWCL
d) IGYL ans(c) -C

48)If we want to transfer collection of values from one program to


another program with the help of one variable , what is to be done?
a)Have those in a group and send that with the group name alone.
b)Send one after another
c)Send one variable and wait for the response.
d)None ans(a) -C

49)With the help of MOVE CORR statement can we modify a


subscript value?
a)yes
b) no
c)may be
d)can’t say ans(b) -C

50)Because of what error in COBOL program , a SOC7 error is


occurred in a job?
a) Data Mismatch
b)Data protection
c)Data invalid
d)Data Unavailable. Ans(a) -C

cobol :
1) Can you redefine an X(200) field with a field of X(100) ?
a. Yes
b. No
c. Can’t say

2) How is sign stored in a COMP field?


a. In the least significant bit
b. In the last nibble
c. Over punched with the numeric value
d. In the most significant bit

3) How many bytes will a S9(8) COMP field occupy?


a. 8 bytes
b. 4 bytes
c. 2 bytes
d. 5 bytes

4) What is SET TO TRUE all about?


a. Set value to condition name variable
b. Set value to related data item
c. Set value to index
d. None

5) What is the length of PIC 9. 99?


a. 3
b. 4
c. 5
d. 2

6) 01 TEST RECORD
02 FIRST PIC X(4)
02 SECOND REDEFINES FIRST PIC S9(4) COMP
will give
a. S0C7
b. Logic error
c. Compile error
d. No error

7) The PIC clause of file status should be


a. XX.
b. 99
c. AA
d. a or b
8) What is the mode in which you will OPEN a file for writing?
a. OUTPUT
b. INPUT
c. EXTEND
d. a & c

9) In a COBOL PERFORM statement, when is the condition tested?


a. After the perform
b. Before the perform
c. Can’t say
d. System dependent

10) COPY statement requires _____ compiler option to be in effect


a. RENT
b. LIB
c. DYNAM
d. NODYNAM

11) The Max length of Parm Parameter is


a. 100
b. 200
c. 75
d. None of the Above

12) The Logical Name of the File will be assigned to


a. DD Name
b. Step Name
c. Job Name
d. Joblib

13) What is mean by Half Word Binary


a. S9(8) comp
b. S9(4) comp
c. 9(4) comp
d. S9(2) comp

14) When displaying a data-name, it _______ be part of an output


record.
a. Must
b. Mustn’t
c. Need not
d. Can’t say

15) The ___ cobol verb is used while updating a file.


a. Write.
b. Update.
c. Read
d. Rewrite

16) The____ statement release the resources which are assigned to


that file
a. STOP RUN
b. EXIT.
c. WRITE
d. END

17) In a sort file, names used must be in the ........entry.


a. FD
b. SD
c. MD
d. None

18) In an EVALUATE statement, can we give a complex condition on


a when clause?
a. Yes
b. No

19) Can a copy member with nested COPY statements


contain the Replacing option?
a. Yes
b. No

20) Consider the following program.


PERFORM 10 TIMES
IF A=B
NEXT SENTENCE
ELSE
DISPLAY B
END-IF
END-PERFORM.
If after 5th iteration A becomes equal to B then what happens.
a. Program will go into a loop.
b. It will do the 6th iteration.
c. It will come out of the perform loop.
d. It will come out of the if loop and do the 6th iteration.

1) If PIC clause for a data item is PPPP999 and the value moved to
the data-item is 234 then the edited value taken is
a. 234
b. 2340000
c. .0000234
d. None of the above

2) To update an indexed record we use a __________ statement.


a. Update
b. Write
c. Rewrite
d. Read

3) When displaying a data-name, it _______ be part of an output


record.
a. Must
b. Mustn’t
c. Need not
d. Can’t say

4) The device specified in the Environment Division will change


significantly, if the program is run on the different computer.
a. True
b. False

5) 01 TRANSACTION-REC.
05 DATE-OF-SALE PIC 9999.
10 MONTH PIC 99.
10 YEAR PIC 99.
a. It’s a valid statement(entry)
b. It’s an invalid statement(entry)

6) Identify the correct statement;


a. Unlike a Write statement in which the file-name is specified, a
Read statement specifies the record-name.
b. Unlike a Read statement in which the file-name is specified, a
Write statement specifies the record-name.
c. Both are incorrect.

7) In file handling, the file status of 34 indicates


a. Permanent error
b. Permanent error due to boundary violation
c. Invalid key due to boundary violation
d. Invalid key due to no record found
8) How is sign stored in packed decimal representation of fields
a. Sign is stored as a binary value in the last nibble of storage
b. Sign is stored as a hex value in the last nibble of storage
c. As a default, sign is over punched with the numeric value stored in
the last byte
d. None of the above

9) If you were passing a table via linkage


a. A subscript is preferable
b. Index is preferable
c. Both can be used
d. Can’t say

10) Indicate which of the following statement is not allowed when a


relative file is opened in I-O mode and access is RANDOM.
a. READ
b. WRITE.
c. REWRITE
d. START.

11) The ___ cobol verb is used while updating a file.


a. Write.
b. Update.
c. Read
d. Rewrite

12) The____ statement release the resources which are assigned to


that file
a. STOP RUN
b. EXIT.
c. WRITE
d. END

13) The sort file name in the SORT syntax used must be in a
........entry.
a. FD
b. SD
c. MD
d. None

14) In an EVALUATE statement, can we give a complex condition on


a when clause?
a. Yes
b. No

15) What is the Next Sentence statement.


a. Gives control to the next verb after the explicit scope terminator
b. Gives control to the next line
c. Gives control to the verb following the last period.
d. A AND B..

16) Can a copy member with nested COPY statements


contain the Replacing option?
a. Yes
b. No

17) Called program can contain Call statements.


a. True
b. False

18) In ......organization the records are stored in contiguous


allocation.
a. Sequential
b. Indexed
c. Relative
d. None

19) If you want to store two variables say, subscript and amount in a
COMP and COMP-3 field, which one is preferred.
b. For a subscript COMP is preferred and for the amount COMP-3 is
preferred.
c. For a subscript COMP-3 is preferred and for the amount COMP is
preferred.
d. For a both subscript and amount COMP is preferred.
e. For a both subscript and amount COMP-3 is preferred.

20) Consider the following program.


PERFORM 10 TIMES
IF A=B
NEXT SENTENCE
ELSE
DISPLAY B
END-IF
END-PERFORM.
If after 5th iteration A becomes equal to B then what happens.
a. Program will go into a loop.
b. It will do the 6th iteration.
c. It will come out of the perform loop.
d. It will come out of the if loop and do the 6th iteration.

1) JUSTIFIED RIGHT
a. Eliminates the need for extra filler area
b. Move in the procedure division is required to achieve right-
justification of data
c. Both (a) and (b)
d. None of the above

2) OCCURS clause can be specified for


a. An elementary item
b. Group item
c. Both (a) and (b)
d. None of the above

3) ___________ verb is used to alter the value of index in COBOL


a. Alter
b. Move
c. Set
d. Both (b) and (c)

4) To update an indexed record we use a __________ statement.


a. Update
b. Write
c. Rewrite
d. Read

5) When displaying a data-name, it _______ be part of an output


record.
a. Must
b. Mustn’t
c. Need not
d. Can’t say

6) In the statement; CALL literal-1 USING identifier-1 ….


The identifier specified in the USING clause is defined in
a. Working-storage section
b. Linkage-section
c. File-section
d. Local-storage section

7) The device specified in the Environment Division will change


significantly, if the program is run on the different computer.
a. True
b. False

8) ADD CORRESPONDING identifier-1 TO identifier-2.


a. Identifier-1 and identifier-2 must not be data items with level
numbers 66, 77, and 88
b. Identifier-1 and identifier-2 can have a REDEFINES clause
c. Identifier-1 and identifier-2 can have a OCCURS clause
d. All the above

9) PERFORM RANGE-TO-BE-EXECUTED
VARYING I FROM 1 BY 1 UNTIL I>15
AFTER J FROM 1 BY 1 UNTIL J>10
a. The range RANGE-TO-BE-EXECUTED will be performed 150 times
b. The range RANGE-TO-BE-EXECUTED will be performed 15 times
c. The range RANGE-TO-BE-EXECUTED will be performed 1 times
d. Won’t be performed, there will be a error message

10) The ____________ statement can only be used if the file is


opened in I-O mode
a. Write
b. Read
c. Rewrite
d. All the above

11) A COPY statement cannot occur within another COPY statement


a. True
b. False

12) In file handling, the file status of 34 indicates


a. Permanent error
b. Permanent error due to boundary violation
c. Invalid key due to boundary violation
d. Invalid key due to no record found

13) The utility for compiling COBOL program is


a. IEWL
b. IGYCRCTL
c. IGYCTCRL
d. IKJEFT01

14) How is sign stored in packed decimal representation of fields


a. Sign is stored as a binary value in the last nibble of storage
b. Sign is stored as a hex value in the last nibble of storage
c. As a default, sign is over punched with the numeric value stored in
the last byte
d. None of the above

15) While defining a variable with COMP-1


a. Picture clause may be given
b. Picture clause need not be given
c. Picture clause cannot be given
d. Picture clause must be given

16) How many bytes does a S9(7) SIGN TRAILING SEPARATE field
occupy
a. 4 bytes
b. 6 bytes
c. 8 bytes
d. 10 bytes

17) Mismatch in LRECL or BLKSIZE or RECFM between COBOL


program and the JCL gives you a file status of
a. 35
b. 37
c. 39
d. 41

18) If you were passing a table via linkage


a. A subscript is preferable
b. Index is preferable
c. Both can be used
d. Can’t say

19) Consider the following code:


01 WS-N PIC 9(2) VALUE ZERO.
A-PARA.
MOVE 5 TO WS-N.
PERFORM B-PARA WS-N TIMES.
B-PARA.
MOVE 10 TO WS-N.
How many times will B-PARA be executed
a. 5 times
b. 50 times
c. 15 times
d. Zero times

1. Data name in COBOL may have a maximum of


a) 18 characters
b) 30 characters
c) 24 characters
d) 8 characters

2. The difference between ‘*’ and ‘/’ is that in case of ‘/’ the
comment line will be printed after page ejection.
a) True
b) False

3. The maximum length of numeric literals can be


a) 120 digits
b) 18 digits
c) 44 digits
d) None of the above

4. The maximum length of non-numeric literals can be


a) 18 characters
b) 124 characters
c) 254 characters
d) 120 characters

5. While defining a numerical data item, the occurrence of ‘P’


indicates the position of the assumed decimal point when the point
lies ______________ the data item.
a) Inside
b) Outside
b) Within
d) None of the above

6. Paragraph names need not be unique in the entire program


a) True
b) False
c) Can’t say

7. A level 66 entry cannot rename another


a) Level 01 and level 77 entry
b) Level 66 and level 88 entry
c) Level 01 and level 88 entry
d) Level 01, 66, 77, 88 entry

8. The USAGE clause cannot be specified for


a) Level 01 and level 77 entry
b) Level 66 and level 88 entry
c) Both (a) and (b)
d) There is no such restriction

9. Which of the following is a packed decimal data representation


a) COMP
b) COMP-1
c) COMP-2
d) COMP-3

10. An index data item cannot be specified in a MOVE statement


a) True
b) False

11. In reference modification, the data name must have USAGE


a) DISPLAY
b) COMP
c) COMP-3
d) Can’t say

12. SUBTRACT C from 100 is


a) Valid
b) Invalid
c) Can’t say

13. In the statement, SORT file-name1 ON ASCENDING KEY data-


name1 USING file-name2 GIVING file-name3
a) file-name2 and file-name3 can be same
b) file-name2 and file-name3 must be different
c) Can’t say

14. The CALL… BY CONTENT technique


a) Can change the original data values in caller’s storage
b) Cannot change the original data values in the caller’s storage
c) Allows the sub-program to access and process a copy of the data-
items from the caller’s storage
d) Both (a) and (c)
15. If a data item is given packed decimal representation and value
to be stored is +3456789 then the PIC clause will be
a) S9(8)
b) S9(4)COMP-3
c) S9(4)COMP
d) S9(8)COMP-3 ???????????

17. The purpose of POINTER phrase in STRING command is


a) To specify the leftmost position within sending field where the
first character will be stored
b) To specify the leftmost position within receiving field where the
first transferred character will be stored
c) To specify the rightmost position within sending field where the
first character will be stored
d) To specify the rightmost position within receiving field where the
first transferred character will be stored

18. Consider the two statements:


1) WRITE print-rec FROM heading-9
2) MOVE heading-9 TO print-rec
WRITE print-rec
a) The output of both (1) and (2) will be same
b) The output of both (1) and (2) will be different
c) There is some syntax error in (1)
d) There is some syntax error in (2)

19. Level-number data-name1 REDEFINES data-name2


a) In the above statement the level-number of data-name1 and
data-name2 must be identical
b) In the above statement the level-number of data-name1 and
data-name2 must be different
c) In the above statement the level-number of data-name1 and data-
name2 can be different
d) The given syntax is incorrect

20. ADD CORRESPONDING identifier-1 TO identifier-2.


a) Identifier-1 and identifier-2 must not be data items with level
numbers 66, 77, 88
b) Identifier-1 and identifier-2 can have a REDEFINES clause
c) Identifier-1 and identifier-2 can have a OCURS clause
d) All the above
Q1) What does the INITIALIZE verb do with alphanumeric items?
1) Set to Zero
2) Set to SPACES
3) 9’s will be inserted
4) None

Q3) What does SEARCH ALL do?


1) Linear search
2) Bubble sort
3) Binary search
4) None

Q5) What compiler option must be given for array bounds checking
1) NOSSRANGE
2) SSRANGE
3) DYNAM
4) LIB
Q7) Can you redefine an X(200) field with a field of X(100) ?
1) Yes
2) No
3) Can’t say

Q9) How is sign stored in a COMP field?


1) In the least significant bit
2) In the last nibble (COMP3)
3) Over punched with the numeric value
4) In the most significant bit (COMP)

Q15) What is SET TO TRUE all about?


1) Set value to condition name variable
2) Set value to related data item
3) Set value to index
4) None

Q17) What is the length of PIC 9. 99?


1) 3
2) 4
3) 5
4) 2
Q23) What is not valid statement
1) Add corresponding group-item1 to group-item2
2) Subtract corresponding group-item1 from group-item2
3) Move corresponding group-item1 to group-item2
5) Multiply corresponding group-item1 by group-item2

Q25) What is meant by S0C-07 system ABEND code?


1) Data exception
2) Memory violation
3) Division by zero
4) Missing DD name

Q28) Linkage Section comes under


1) Identification Division
2) Environment Division
3) Data Division
4) Procedure Division

Q31) Stop Run statement can be coded only_________ times in the


source.
1) 1 time ?????????
2) 3 times
3) 2 times
4) As many as required

Q33) Following is a valid cobol user-defined word


1) DATA ????
2) 34B100-PARA1
3) -48B
4) GROSS PAY

Q35) COBOL stands for


1) Common business oriented language
2) Command business oriented language
3) Common business organized language
4) None

Q37) Consider the following PROCEDURE DIVISION statements

INSPECT ALPHA TALLYING COUNTER FOR LEADING “A”


Let the picture of ALPHA be X(20) and suppose its initial content is as
follows ANANDAbKUMARbMAI (where b denotes blank space).
If COUNTER (whose PICTURE is 99) originally contains 08 then after
execution of the INSPECT statement, COUNTER will have
1) 13
2) 09
3) 28
4) 5

Q39) Occurs clause cannot be used for


1) Level number 01
2) Level number 02
3) Level number 49
4) None

Q43) You have a string MAINFRAME. Which of the following


statement will give you ‘MAIN’
1) MAINFRAME(1:4)
2) MAINFRAME(0:4)
3) MAINFRAME(:4)
4) MAINFRAME(4:)

Q47) What GOBACK will do if it is coded in subprogram


1) Returns control to the calling program
2) Returns control to the system
3) No effect
4) None

Q49) 01 TEST RECORD


02 FIRST PIC X(4)
02 SECOND REDEFINES FIRST PIC S9(4) COMP
will give
1) S0C7
2) Logic error
3) Compile error
4) No error

8) What is the mode in which you will OPEN a file for writing?
a. OUTPUT
b. INPUT
c. EXTEND
d. a & c

 What is the result of the following?

MOVE 1 TO VAR1
MOVE 2 TO VAR2

EVALUATE TRUE

WHEN VAR1=1
PERFORM PARA-1
WHEN VAR2=2
PERFORM PARA-2
WHEN OTHER
NEXT SENTENCE
END-EVALUATE.

A) PARA-1 will be performed


B) PARA-2 will be performed
C) Both PARA-1 and PARA-2 will be performed.
D) Compile error for incorrect use of NEXT sentence

 Which of the following is an INCORRECT specification for a data-name?

A) var-var1
B) data1
C) two
D) all

(ALL is a reserved word)

 What is the result of the following?

MOVE 1 TO VAR1
MOVE 2 TO VAR2

EVALUATE TRUE

WHEN VAR1=1
PERFORM PARA-1
WHEN VAR2=2
PERFORM PARA-2
WHEN OTHER
DISPLAY VAR1
END-EVALUATE.

A) PARA-1 will be performed


B) PARA-2 will be performed
C) Both PARA-1 and PARA-2 will be performed.
D) Compile error for incorrect use of NEXT sentence

 Which of the following PIC clause is invalid as a floating symbol?

A) +
B) $
C) S
D) -

 What is the result of the following?

MOVE 0 TO VAR1

EVALUATE TRUE

WHEN VAR1=1
PERFORM PARA-1
WHEN VAR1=2
PERFORM PARA-2
WHEN OTHER
PERFORM PARA-3
END-EVALUATE.

A) PARA-1 will be performed


B) PARA-2 will be performed
C) Both PARA-1 and PARA-2 will be performed.
D) PARA-3 will be performed

 Which of the following is an invalid paragraph name?

A) A-1
B) 999
C) A+1
D) ZZ9

 What is the result of the following?


MOVE 0 TO VAR1

EVALUATE TRUE

WHEN VAR1=1
PERFORM PARA-1
WHEN VAR1=2
PERFORM PARA-2
END-EVALUATE.

A) PARA-1 will be performed


B) PARA-2 will be performed
C) Both PARA-1 and PARA-2 will be performed.
D) None of the above

 Which of the following is correct definition of figurative constant in


COBOL?

A) Constants that are represented as alphanumeric text also known as non-


numeric literals.
B) Constants that are represented in terms of digits, also known as literals
C) Data names that are initialized to specific values in DATA DIVISION and
retain those values throughout the execution of the program.
D) Reserved words that are used as substitutes for certain special
constants - numeric and alphanumeric

 Where does AREA A in COBOL extends from?

A) 8-16
B) 8-11
C) 12-72
D) 8-10

 According to the given declarations in Data Division. How many


elementary items are described below?

05 CALENDAR-DATE.
08 CALENDAR-DAY PIC 99.
08 CALENDAR-MON PIC 99.
08 CALENDAR-YEAR PIC 99.
05 FILLER PIC X(5).
05 VAR1 PIC XX.
05 VAR2 PIC X.
05 END-DATE.
10 FILLER PIC X(4).
10 END-YEAR PIC 99.

A) 3
B) 6
C) 4
D) 5

 Where does AREA B in COBOL extends from?

A) 8-16
B) 8-11
C) 12-72
D) 8-10

 FILE-CONTROL paragraph in a COBOL program appears in

A) Input-Ouput Section in Environment Division


B) File Section in Data Division
C) Procedure Division, it can only be a user-defined paragraph
D) Configuration Section in Environment Division

 Program-id a paragraph name in IDENTIFICATION division?

A) True
B) False

 The Procedure Division of a program contains the statement


WRITE MASTER-REC
This suggests that the OPEN statement for this file
must NOT be

A) OPEN INPUT
B) OPEN EXTEND
C) OPEN INPUT-OUTPUT
D) OPEN OUTPUT

 Program-id is compulsory?
A) True
B) False
 Program-id should necessary be same as member name of COBOL
program?
A) True
B) False

 Rounded precedes the ON SIZE ERROR ?


A) True
B) False

 A Numeric literal in COBOL can have at most how many digits?


A) 10
B) 160
C) 18
D) 32

 A Non Numeric literal in COBOL can have at most how many digits?

A) 10
B) 160
C) 18
D) 32

 A 01 level cannot have PIC clause?

A) True
B) False

You might also like