Monday, 23 May 2011

COBOL INTERVIEW QUESTIONS 1

(1) Index in Cobol is defined as _______

a) Array occurence 
b) Displacement from begining of Array 
c) It is sequentially accessible 
d) Not for Random process



(2) Study the following : 
01 A PIC 99v0 value 5. 
01 B PIC 9V9 VALUE 6. 
01 C PIC 99V9 VALUE 2.8.
01 D PIC 99 VALUE 3.
COMPUTE A ROUNDED B C = A + B * C / D 


a) A=11,B=0.6,c=10.6 
b) A=10,B=0.6,C=10.6 
c) A=11,B=0,C=10 
d) A=10,B=6,C=10


(3) Which of the following statements will not indicate duplicate key warning if it occurs in case of an indexed organisation without DUPLICATES Phrase 

a) Read 
b) Write 
c) Rewrite 
d) Delete


(4) What will happen if you code GO BACK instead of STOP RUN in a standalone COBOL program i.e. a program which is not calling any other program? 

a) Shows Error 
b) Nothing happened 
c) Return to previous step 
d) Infinite Loop


(5) In packed decimal number +2431 how would be stored? 

a) +2431f 
b) 02431f 
c) 02431 
d) +2431


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

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



(7) Given the following Data Division Entries : 
01 T1. 
03 N PIC 99. 
03 T2. 
04 M OCCURS 1 TO 20 DEPENDING ON N. 05 P PIC XX.
Indicate which one of the following is incorrect? 


a) T1 will have variable size. 
b) m will have variable no of occurences 
c) T2 will have variable size. 
d) The above description is wrong


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

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


(9) How can you reference an element of a 3 dimensional table? 

a) 2 indexes 
b) Subscripts 
c) Search 
d) Search-all


(10) Identify the Syntax error in the following : 
01 B pic A(7). 
02 C PIC 9(4). 
.....................
IF(B NUMERIC) 
ADD 10 TO C.
 

a) condition in the if statement is wrong. 
b) nothing is wrong 
c) C is initialized,Add 10 TO C is wrong. 
d) both b and c should have the same size


(11) Temp files can be defined as 

a) DSN=&&TEMP 
b) DSN=&TEMP 
c) DSN=&&XYZ 
d) BOTh a) and c) are true 


(12) What do you mean by file status 37. 

a) File attribute mismatch 
b) file logically error 
c) Open specified on the file that doesn’t support open mode. 
d) File opened in write mode


(13) How is sign stored in Packed 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



(14) Consider the following two statements 
MOVE 10 TO N. 
PERFORM PARA-X N TIMES 
STOP RUN. 
PARA-X. 
MOVE 5 TO N. How many times PARA-X will be executed? 


a) 10 
b) 05 
c) Infinite 
d) Execution Error


(15) How do you set a return code to the JCL from a COBOL program 

a) By moving a value to RETURN-CODE reg 
b) By moving a value to RETURN_CODE 
c) By moving a value to RCODE 
d) By moving a value to RETURNCODE


(16) 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.


(17) PERFORM ACCULATE-TOTALS VARYING A FROM 1 BY 2 UNTIL A > 2 AFTER B FROM 1 BY 1 UNTIL B > 2 AFTER C FROM 2 BY -1 UNTIL C < -9 How many times accumulate-totals will be executed? 

a) 10 
b) 09 
c) 11 
d) infinite loop.


(18) How many times PARA-A is performed 
PERFORM PARA-A VARYING TIMES-COUNTER FROM 1 BY 1 UNTIL TIMES-COUNTER > 0. 
STOP RUN. 
PARA-A. 
SUBTRACT 1 FROM TIMES-COUNTER.
DISPLAY “HAI”. 


a) 10 
b) infinite loop 
c) 2 
d) 0


(19) Consider the following:

77 W-NUM PIC 9 VALUE 0. 
---------------- 
MOVE 1 TO W-NUM 
PERFORM PARA-X UNTIL W-NUM ] 9.
- ------------ 
PARA-X. 
ADD 1 TO W-NUM

How many times PARA-X will execute? 


a) 12 
b) 10 
c) 09 
d) Infinite Loop


(20) Indicate what value will be displayed after the execution of the DISPLAY statement in the paragraph named P3.
MOVE 2 to M.
P1. 
PERFORM P2 9 TIMES. 
P2. 
MULTIPLY 2 BY M. 
P3. 
DISPLAY M 


a) 2048 
b) 2036 
c) 1048 
d) None of the above


(21) What is the compiler option to show line where the error occurred? 

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


(22) Consider the following program statements 
MOVE 0 TO SW. 
PERFORM PRI-OUT UNTIL SW=1 
DISPALY NO-OF-REC 
STOP RUN 
PRI-OUT.
READ IN-FILE AT END MOVE 1 TO SW. 
WRITE OUO-REC FROM IN-REC.
ADD 1 TO NO-OF-REC.

if the IN-FILE contains 1000 records what value will be displayed after the PERFORM is over? assume that NO-OF-REC has PIC 9(4) 


a) 1000 
b) 1001 
c) 1 
d) None of the above


(23) 
77 WA PIC 9(3)V99 VALUE 23.75
77 WB PIC ZZ9V99 VALUE 123.45
After MOVE WA TO WB The contents of WB will be ? 


a) b2375 ( b indicates space ) 
b) 023.75 
c) b23.75 ( b indicates space ) 
d) None of the above


(24) The ---- Statements has always allowed you to develop program functions that can be stored seperately from other program code and then be included in the program at 

a) Perform and Evaluate 
b) copy and perform 
c) call and perform 
d) Copy and call



(25) Identify the incorrect statement 

a) CALL MY-SUB 
b) CALL MY-SUB ON OVERFLOW GO TO PARA1. 
c) CALL MY-SUB USING PARM-1. 
d) CALL MY-SUB USING PARM-1 UNTIL PARM-1=10

DB2 INTERVIEW QUESTIONS

(1) In the WHERE clause what is BETWEEN and IN? – 

a) Group of items refered 
b) BETWEEN supplies a range of values while IN supplies a list of values 
c) Both A and B 
d) None of the above


(2) Which of the following degrades performance? 

a) Union 
b) Commit 
c) Union All 
d) Intersection All


(3) How to find out the total number of rows in a DB2 table? 

a) COUNT(*) 
b) DISTINCT 
c) MAX 
d) GROUP BY


(4) The Number of bytes occupied by SQLCA is 

a) 128 bytes 
b) 136 bytes 
c) 142 bytes 
d) 138 bytes


(5) DCLGEN supplied with DB2 produces _______________ and say whether it is must / not required.

a) SQLCA in side program and it is must 
b) Table declaration and it is must 
c) Table declaration and it is not required 
d) reads the catalog to check for table and must


(6) Give the Sql Code for Program name not found in the PLAN_NAME 

a) -811 
b) -817 
c) -805 
d) -803


(7) How do you retrieve the first 5 characters of FIRSTNAME column of DB2 table EMP ? 

a) FIRSTNAME(SUBSTR) 
b) FIRSTNAME(SUBSTR,1,5) 
c) SUBSTR(FIRSTNAME,1,5) 
d) SUBSTR(1,5,FIRSTNAME)


(8) What is SPUFI 

a) SQL processor User Friendly Interface 
b) SQL Processor User Friendly Interaction 
c) SQL Processor Using File Input 
d) SQL Processing User Friendly Input


(9) Where are the access path information are stored? 

a) Plan table 
b) Package table 
c) Files 
d) None of the above


(10) How do you eliminate duplicate values in DB2 SELECT ? 

a) DISTINCT 
b) ORDER BY 
c) GROUP BY 
d) COUNT


(11) Given the following DDL statements: 
CREATE TABLE tab1 (a INT, b INT, c INT) 
CREATE VIEW v1 AS SELECT a,b,c FROM tab1 WHERE a > 250 WITH CHECK OPTION 
Which of the following INSERT is correct 


a) INSERT INTO tab1 VALUES (200, 2, 3) 
b) INSERT INTO v1 VALUES (300, 2, 3) 
c) INSERT INTO tab1 VALUES (350, 2, 3) 
d) INSERT INTO v1 VALUES (250, 2, 3)


(12) Which of the following statements will display the player’s name, number and points for all players with an entry in both tables? 

a) SELECT names.name,names.number, points.points FROM names RIGHT OUTER JOIN points ON names.name=points.name 
b) SELECT names.name,names.number, points.points FROM names INNER JOIN points ON names.name=points.name 
c) SELECT names.name,names.number, points.points FROM names LEFT OUTER JOIN points ON names.name=points.name 
d) None of the above


(13) Which of the following occurs if an application ends abnormally during an active unit of work? 

a) The unit of wok moves to pending state 
b) The unit of work moves to CHECK_PENDING 
c) The unit of work is rolled back 
d) The unit of work remains active


(14) For which of the following database objects can locks be explicitly obtained? 

a) User-defined Data Type 
b) Columns 
c) Triggers 
d) Tables


(15) Where are referential constraint definitions stored? 

a) The explain tables 
b) SYSIBM.SYSTRIGGERS 
c) The user table 
d) The system catalog tables


(16) What type of locks are handled by ISOLATION 

a) Page level 
b) Table level 
c) Table space level 
d) House hold locks


(17) Which SQLCode suits apt that denote a Timestamp error 

a) -408 
b) -305 
c) -911 
d) -818


(18) SQLCODE -924 describes 

a) Dead lock or Resource unavailable 
b) DB2 Connection error 
c) Commit not void 
d) None of the above


(19) SQLCODE -183 describes 

a) String representation of date is invalid. 
b) DB2 connection error 
c) Not a valid range 
d) None of the above


(20) A table contains a list of all seats on an airplane. A seat consists of seat number and whether or not it is assigned. An airline agent lists all the unassigned seats on the plane. When the agent refreshes the list from the table, the list should not change. Which of the following isolation levels should be used for this application? 

a) Read Stability 
b) Uncommitted Read 
c) Repeatable Read 



(21) SQLCODE -911 describes 

a) Dead lock or Resource unavailable 
b) Resource type not available 
c) Unsucessful execution 
d) Object has been deleted


(22) What is CHECK PENDING ? 

a) Table is checked against the constraint 
b) Database is checked against the referential constraint 
c) LOADed with ENFORCE NO option, then the table is left in CHECK PENDING status 
d) Table is left in check pending status



(23) Select name, salary from employee-table where exists (select * from dept where deptno LIKE 'c%') 
The above SQL will fetch the names and salaries of all the employees where department name starts with 'c' 


a) True 
b) False 
c) Query is incorrect - throws error 
d) None of the above


(24) SQLCODE -205 describes 

a) Object already exists 
b) No primary key mentioned 
c) Column name is not column of table 
d) None of the above