cobol-interview-questions-6

 

  • Is 0123 a valid section name?
 
A) True
B) False
 
  • OCCURS clause cannot be specified for 01 and 77.
 
A) True
B) False
 
  • How many bytes would S9(9)V99 occupy?
 
A) 11
B) 12
C) 6
D) 13
 
  • Can index be manipulated using ADD & SET verbs
 
A) Yes
B) No (Only Set)
 
 
  • Identify the correct statement.
 
A) PERFORM WITH TEST AFTER is the default. 
B) PERFORM WITH TEST BEFORE is the default. 
 
 
  • How many times PARA-1 is executed when SUB is with PIC 9.
    PERFORM PARA-1 VARYING SUB FROM 1 BY 1 UNTIL SUB = 10.
 
    PARA-1.
         DISPLAY SUB.
 
A) 10 times
B) 9  times
C) Keep looping (as SUB will become 0 when increased to 10)
D) None of these
 
  • ·  Is is possible to redefine a field with X(7) to X(10) ?
 
A) True
B) False
 
 
  • If the number of occurrences cannot be determined in the OCCURS
    clause which option is used.
 
A) Depending
B) Depends on
C) On condition
D) None of the above
 
  • Identify the incorrect statement
 
A) Linkage Section is mandatory in sub programs. 
B) Linkage section can be defined in sub program.
C) Linkage section is used to pass data between program.
D) Linkage section must appear after working storage section.
 
  • Identify the correct statement.
 
A) Called program can contain call statements. 
B) Called program must not contain call statements.
C) Called program must contain call statements.
D) Only calling program can contain call statements.
 
 
  • How many bytes will a S9(10) COMP-3 field occupy?
 
A) 10
B) 11
C) 6
D) 5
 
 
  • Identify the incorrect statement
 
A) It can be specified only for elementary items and not for group items.
B) It can not be specified with edited alphanumeric items.
C) It can not be used with level 66 and level 88 
D) It can be used to change the default movement of alphabetic and alphanumeric items.
E) It can not be used with numeric data items.
 
  • What is the result of the following?
 
VAR1 is defined as PIC 9(7).
 
MOVE ‘1234567’ to VAR1
 
A) Compilation error
B) S0C7 abend at runtime
C) VAR1 would contain 1234567
D) None of the above
 
  • What would happen with the following statement?
 
01 VAR1  PIC 9(7) JUST RIGHT.
 
A) The movement of values in VAR1 will be from left to right.
B) The movement of values in VAR1 will be from right to left.
C) The movement of values in VAR1 will not change.
D) Result in compilation error.
 
 

 

  • Answer the question considering the following code
       MOVE  15 TO SUBJ
       MOVE  15  TO SUBI
       PERFORM PARA-ABC WITH TEST BEFORE UNTIL SUBI  > 14.
 
     PARA-ABC.
        ADD 1 TO SUBJ
 
  • What will be the value of SUBJ on execution of the above code.
 
A) 15
B) 16
C) COMPILE ERROR
D) Infinite loop.
 
  • How many bytes of storage are required to hold emp-sal-rec which
    is defined as follows.
    01 emp-sal-rec.
       05 sal-history occurs 12 times.
          10 sal pic 9(4)v99.
          10 months pic z9.
          10 deductions occurs 5 times pic 9(3)v99.
 
A) 396
B) 384
C) 456
D) 122
 
  • Identify the correct statement
 
A) Group items can have value clause but the elementary items under them should not have value clause in such situation.
B) Only Group items can have value clause
C) Elementary items can not have value clause
D) Group items must have value clause
 
 
  • Identify which of these are the correct declaration?
 
1)       01 VAR1 VALUE 'ABCDE'.
          05 VAR2 PIC X(3).
          05 VAR3 PIC X(2).
 
2)       01 VAR1.
          05 VAR2 PIC X(3) VALUE 'ABC'.
          05 VAR3 PIC X(2) VALUE 'DE'.
 
3)       01 VAR1 VALUE 'ABCDE'.
          05 VAR2 PIC X(3) VALUE 'ABC'.
          05 VAR3 PIC X(2) VALUE 'DE'.
 
4)       01 VAR1 PIC X(5) VALUE 'ABCDE'.
          05 VAR2 PIC X(3).
          05 VAR3 PIC X(2).
 
A) 1 and 2
B) 1 and 3
C) 2 and 4
D) 2 and 3
 
 
  • Identify the correct statement.
 
 
A) The START instruction positions and reads record.
B) The START instruction positions record. 
 
 
  • If VAR1 = "XYZ" OR  VAR1 = 123
        PERFORM A-PARA.    
 
can be valid COBOL statement.
 
A) True
B) False
 
 
  • Add  VAR1 to VAR2 on SIZE ERROR DISPLAY "Size Error" is
 
A) Imperative statement 
B) Conditional statement 
C) Both 
D) None