Cobol Qustions
Cobol Qustions
1 :
A) FILE SECTION
B) LINKAGE SECTION
C) WORKING STORAGE SECTION
D) INPUT-OUTPUT SECTION
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
10- What are the ACCESS MODE available in COBOL for a sequential file?
a) SEQUENTIAL
b) RANDOM
c) DYNAMIC
d) All 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
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
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
77 A PIC 9 VALUE IS 1.
PROCEDURE DIVISION.
EVALUATE TRUE
WHEN A = 1
DISPLAY "CASE1"
WHEN OTHER
DISPLAY 'OTHER"
END-EVALUATE
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
5 through 9
4 bytes (fullword)
10 through 18
8 bytes (doubleword)
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 :
2- Which one of the following uses the value of occurrence in case of arrays ?
A) DISP
B) BINARY
C) INDEX
D) SUBSCRIPT
PROCEDURE DIVISION.
MOVE 'ABCDE' TO WS-VAR1.
7- A Cobol Sentence
A) Collection of PARAGRAPHS
B) Collection of SECTIONS
C) Collection of DIVISIONS
D) Collection of statements
A) AAAAA
B) A
C) Cannot redefine a table directly
D) None
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
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
COBOL L1 :
4- A value clause can be specity for a Numeric edited PIC clause (PIC
ZZ9.99)
A) YES
B) NO
Cobol
ans( a)-M
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
a) C IS GREATEST.
b) C IS NOT GREATEST
c) Error d)None ans(a) -M
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
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
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
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
cobol :
1) Can you redefine an X(200) field with a field of X(100) ?
a. Yes
b. No
c. Can’t say
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
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
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)
13) The sort file name in the SORT syntax used must be in a
........entry.
a. FD
b. SD
c. MD
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.
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
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
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
2. The difference between ‘*’ and ‘/’ is that in case of ‘/’ the
comment line will be printed after page ejection.
a) True
b) False
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
8) What is the mode in which you will OPEN a file for writing?
a. OUTPUT
b. INPUT
c. EXTEND
d. a & c
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) var-var1
B) data1
C) two
D) all
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) +
B) $
C) S
D) -
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) A-1
B) 999
C) A+1
D) ZZ9
EVALUATE TRUE
WHEN VAR1=1
PERFORM PARA-1
WHEN VAR1=2
PERFORM PARA-2
END-EVALUATE.
A) 8-16
B) 8-11
C) 12-72
D) 8-10
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
A) 8-16
B) 8-11
C) 12-72
D) 8-10
A) True
B) False
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
A Non Numeric literal in COBOL can have at most how many digits?
A) 10
B) 160
C) 18
D) 32
A) True
B) False