Monday, 23 May 2011

COBOL INTERVIEW QUESTIONS 4

(1) What are different file OPEN modes available in COBOL? 

a) Open for READ, OUTPUT, I-O, EXTEND. 
b) Open for INPUT, OUTPUT, I-O, EXTEND. 
c) Open for READ, WRITE, I-O, EXTEND. 
d) Open for INPUT, OUTPUT, I-O, APPEND


(2) Hierarchy of the execute of logical operators is 

a) NOT AND OR 
b) AND OR NOT 
c) OR NOT AND 
d) OR AND NOT


(3) What is File status 02 ? 

a) Record Key duplicate 
b) End of file 
c) Alternate Key Duplicate 
d) File open Error


(4) Which of the following is not a procedure division verb? 

a) Start 
b) Seek 
c) Rerun 
d) Delete


(5) How many bytes will comp-2 occupy? 

a) 8 bytes 
b) 4 bytes 
c) 16 bytes 
d) 24 bytes


(6) What is the result of the following? DIVIDE A INTO B GIVING C 

a) C=A/B 
b) remainder of B/A is stored in C 
c) C=B/A 
d) The remainder of A/B is stored in C


(7) ON SIZE ERROR can be used along with sz0

a) All arithmetic verbs 
b) Only ADD, COMPUTE and MULTIPLY verbs 
c) only COMPUTE verb 
d) Only ADD verb


(8) What do you mean by file status 39 

a) File opened in wrong mode 
b) File attribute mismatch 
c) File logically error 
d) File opened in write mode


(9) Indicate which one of the following is incorrect 

a) SUBTRACT A B C FROM D E F 
b) SUBTRACT A B C FROM D E GIVING F G. 
c) SUBTRACT A FROM D, B FROM E, C FROM F. 
d) SUBTRACT A FROM B GIVING D E F.


(10) How is sign stored in Zoned Decimal fields? 

a) Sign is stored as a hex value in the last nibble (4 bits ) of the storage 
b) Sign is over punched with numeric value stored in the last bite 
c) Sign is stored in hex value in first 4 bits of storage 
d) None of the above



(11) C1 C2 C3 are three conditions whose TRUTH values are as follows. C1-TRUE C2-FALSE C3-TRUE A,B,C are defined as given below
A:C1 AND(NOT C2) OR C3 
B.(NOT C1) OR (NOT C2 AND NOT C3) 
C.(C1 OR C2)AND C3 
D.C1 AND C2 OR C3 

given the above information which of the following statements are valid? 


a) only A,B and C are TRUE 
b) only A,C and D are TRUE 
c) A,B,C and D are TRUE 
d) only C and D are TRUE


(12) PERFORM RTN-1 VARYING I FROM 1 by 2 UNTIL I > 2 AFTER J FROM 1 BY 1 UNTIL J > 2 AFTER K FROM 2 BY -1 UNTIL K < 1 . HOW MANY TIMES RTN-1 WILL BE EXECUTED ? 

a) 4 times 
b) 5 times 
c) 6 times 
d) 8 times


(13) What is the linkage section? 

a) It is must for called program 
b) It is must for calling program 
c) used for displaying messages in sub program 
d) Temporary storage for called program


(14) What is the compiler option to get 24 digit number?

a) ARITH(EXTEND) 
b) TEST 
c) RENT 
d) ARITH(COMPAT)

COBOL INTERVIEW QUESTIONS 3

(1) How many bytes does a s9(7) SIGN LEADING SEPARATE field occupy? 

a) 8 bytes 
b) 9 bytes 
c) 7 bytes 
d) 6 bytes


(2) Each module of a structured program should have -------- Entry point and -------- exit point 

a) Three,Five 
b) Two,one 
c) One, One 
d) Two, Two


(3) Which of the following files can be opened in all the 4 modes? 

a) indexed 
b) relative 
c) sequential 
d) All of the above


(4) Just one -------- statement allows several alternative paths of execution 

a) evaluate 
b) if statements 
c) perform statement 
d) copy statement


(5) What keyword is used for class testing? 

a) Alphanumeric 
b) Hexadecimal 
c) Numeric edited 
d) Numeric


(6) Which of the following statement is not allowed when a relative file is opened to I/O mode and the access mode is random 

a) read 
b) write 
c) rewrite 
d) start



(7)
PERFORM PARA-A THRU PARA-A-EXIT VARYING A FROM 1 BY 1 UNTIL A=13. 
How many times would the statements in PARA-A execute? 


a) 13 
b) 14 
c) 12 
d) 11


(8) Say whether the following is True or False MARKS GRADE 80-100 A, 80-101 B, 80-102 C 
EVALUATE MARKS
WHEN 80 THRU 100 
MOVE "A" TO GRADE 
WHEN 80 THRU 101 
MOVE "B" TO GRADE 
WHEN 80 THRU 102 
MOVE "C" TO GRADE 
END-EVALUATE 


a) True 
b) False 
c) Compilation Error 
d) None of the above


(9) A compiler checks for: 

a) Runtime errors 
b) Syntax errors 
c) a & b 
d) None of the above


(10) How do you define a variable of COMP-1? 

a) 01 WS-VAR PIC S9(4) COMP-1. 
b) 01 WS-VAR USAGE COMP-1. 
c) 02 WS-VAR COMP-1. 
d) 01 WS-VAR COMp-1 USAGE.


(11) There is a file whose ORGANISATION is INDEXED.you want to read the records from the file in RANDOM fashion as well as sequentially.then which of the access mode would you specify? 

a) SEQUENTIAL 
b) RANDOM 
c) DYNAMIC 
d) ACCESS MODE has nothing to do with it


(12) When you will get the abend SB14? 

a) Data set opened in output mode 
b) PS dataset opened in extend mode 
c) PDS member opened in extend mode 
d) PDS member opened in input mode


(13) Which one of the following cannot cause more than one execution of the paragraph(s) that may be named in the statement. 

a) The simple PERFORM statement 
b) The PERFORM with TIMES option 
c) The PERFORM with UNTIL option 
d) The PERFORM with VARYING option


(14) Consider the following piece of code
01 GROUP-ITEM 
05 AMOUNT-1 PIC 99V9 USAGE COMP VALUE 50
05 AMOUNT-2 PIC 9(4)V99 USAGE COMP
PROCEDURE DIVISION
MOVE ZERO TO GROUP-ITEM.
ADD 50 TO AMOUNT-1.

what will be the content of AMOUNT-1? 


a) 50 
b) 100 
c) 0 
d) unpredictable


(15) Consider the following program segment.
P1.
PERFORM P2 THRU P3 ARYING A FROM 1 BY 1 UNTIL A = 4. 
DISPLAY A. 
STOP RUN.
P2.
ADD 1 TO A.
ADD A TO SUM
P3.
EXIT.

Indicate which of the following will take place. 


a) Compiler will detect a syntax error as the EXIT verb is not required in his case. 
b) There will be an infinite loop. 
c) The program will ultimately stop after displaying 4 
d) None of the above.


(16) A=10, B=5, C=10, D=5, E=0 What will be the value of E after the following statement ADD A, B TO C, D GIVING E. 

a) 15 
b) 10 
c) Runtime Error 
d) Syntax Error

COBOL INTERVIEW QUESTIONS 2


(1) How should an elementary item subscript be declared to be more efficient? 
a) s9(8)comp 
b) s9(16)comp 
c) S9(4)comp 
d) s9(2)comp


(2) A word in the Computer memory is identified by_________ 

a) word length 
b) word size 
c) word address 
d) None of the above


(3) In an EVALUATE statement, can I give a complex condition on a when clause? 

a) Yes 
b) No 
c) Compilation error 
d) Syntax error


(4) What is the other verb for RELEASE and WRITE ? 

a) READ and WRITE 
b) Rewrite and Read 
c) Write and Read 
d) Write and Open


(5) How could you write a program in a structured format? 

a) Bottom-up approach 
b) Each module serving different function 
c) Program is divded into many exit point 
d) No go to's 


(6) Which is more efficient, level 77 OR 01? 

a) 77 
b) 01 
c) Both 
d) Neither


(7) Execution of a subordinate module is caused by the use of the COBOL verbs ------------in the superior module 

a) Perfrom 
b) Search 
c) Evaluate 
d) None of the above


(8) Which of the following is true about the file which is referenced in a delete statement? 

a) Opened in INPUT mode 
b) Opened in OUTPUT mode 
c) Opened I/O mode 
d) None of the above


(9) Can the OCCURS clause be at the 01 level? 

a) Yes 
b) No 
c) only in 77 level number 
d) All of the above


(10) The following are Data division entries
01 A PIC 9(2) VALUE IS 50
01 B PIC 9(3) VALUE IS 950
The following is the procedure Division statement 
ADD A TO B ON SIZE ERROR DISPLAY 'ON SIZE ERROR'
DISPLAY 'B' B 
What is the value of B when it is displayed? 


a) 950 
b) 1000 
c) 100 
d) None of the above


(11) How many sections are there in data division?. 

a) 6 
b) 3 
c) 4 
d) None of the above


(12) An index can be modified only by a 

a) Add 
b) Evaluate 
c) Perform 
d) If


(13) How is sign stored in a COMP field ? 

a) in last nibble 
b) in Least significant bit 
c) In the most significant bit. Bit is ON if -ve, OFF if +ve 
d) None of the above



(14) Indicate which one of the following is not true about the SET verb. 

a) The verb can be used to set one or more indexes to a particular value 
b) The verb can be used to move the current value of an index to one or more identifiers 
c) The verb can be used to increment one or more identifiers by a positive integral value. 
d) The verb can be used to decrement one or more indexes by a positive integral value.


(15) How many bytes are allocated for a data item PIC S9(10) binary . 

a) 5 
b) 6 
c) 8 
d) 10


(16) Consider the below code
01 WS-COUNT PIC 9 VALUE 5.
PROCEDURE DIVISION.
PERFORM NEW-SECTION THRU NEW-SECTION-EXIT WS-COUNT TIMES
STOP RUN.
NEW-SECTION. 
----------------------------- 
MOVE 10 TO WS-COUNT. -------- --------.
NEW-SECTION-EXIT. 
EXIT. 
How many times will NEW-SECTION be performed 


a) 5 times 
b) 10 times 
c) 50 times 
d) will go in loop 


(17) 
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 will b-para will execute? 


a) 10 times 
b) 0 times 
c) 5 times 
d) 50 times


(18) ACCEPT WS-DATE FROM DATE WILL RETURN THE CURRENT DATE 

a) IN DDMMYY FORMAT 
b) IN YYYYMMDD FORMAT 
c) IN YYMMDD FORMAT 
d) IN MMDDYY FORMAT


(19) Can you REWRITE a record in an ESDS file? Can you DELETE a record from it? 

a) Can rewrite (record length must be same), but not delete. 
b) Both rewrite and delete is possible 
c) Can delete ,but can not rewrite 
d) Can not do both



(20) PERFORM RTN-1 VARYING I FROM 1 by 2 UNTIL I > 2 AFTER J FROM 1 BY 1 UNTIL J > 2 AFTER K FROM 2 BY -1 UNTIL K < 1 . 
HOW MANY TIMES RTN-1 WILL BE EXECUTED ? 

a) 4 times 
b) 5 times 
c) 6 times 
d) 8 times