IBM MAINFRAME GURU Forum
  Home      Forum      Online Tutorials      Interview Questions      Mainframe Books      IT News
 


Home  >  Discussion Forum  >  COBOL INTERVIEW QUESTIONS
    

COBOL INTERVIEW QUESTIONS

No of Questions : 74
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next



COBOL INTERVIEW QUESTIONS
1Tag Abend in CICS
Question : 1Tag abend occurs on the below conditions

1) When a program is linked with commarea, the commarea message length should match the input message length expected by the program(data population mismatch)
2) When a program re-turns response to the queue, through a module response values values if not populated correctly the abend occurs.


Thank You,

View Answer(2)

Editing a Copybook - How to?
Question : You have some changes to be made in a copybook.
Like adding a new field and renaming another field.

What all precautions should you take when doing this???

How will you proceed?

View Answer(2)

Cobol question
Question : There is a PS file that gets created everyday with one record and with a character 'A' in it in different positions. How to write a cobol logic to find it's position in the file?

View Answer(4)

VARIABLE FILE IN COBOL
Question : Hi,

I faced a interview question as below

how would you set the variable record length and what is the use of defining file as variable length format.

can any one please reply me what is the gud way to answer to this question.?

View Answer(3)

88 Level default value
Question : I have faced an interview qn as below

01 city pic x(4)
88 valid-city value 'cata'
88 invalid-city value 'xyz'


what is the default value stored in city field ( note city is not initialised)

View Answer(2)

COBOL TEST-4 WITH ANSWERS
Question : IF I AM INCORRECT,CORRECT ME.. PLZ..

(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


(Cool 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)



View Answer(0)

COBOL TEST-3 WITH ANSWERS
Question : IF I AM INCORRECT,CORRECT ME

(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


(Cool 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

View Answer(0)

COBOL TEST-2 WITH ANSWERS
Question : IF I AM INCORRECT,CORRECT ME


(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


(Cool 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


(1Cool 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

View Answer(0)

Cobol Test 1 - Interview Questions
Question : please i need answers for this, these are interview question papers me and my friends attended company in MINDTREE, i hope this will help all students,
please provied answers if u know it is correct.



(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

View Answer(12)

I want to find the 50th city code.how?
Question : plz suggest me anyone...

View Answer(4)

Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next

Home  >  Discussion Forum  >  COBOL INTERVIEW QUESTIONS


   

IBM MAINFRAME - COBOL Interview Questions( 59 )

IBM MAINFRAME - DB2 Interview Questions ( 110 )

IBM MAINFRAME - JCL Interview Questions( 52 )

IBM MAINFRAME - CICS Interview Questions( 70 )

IBM MAINFRAME - VSAM Interview Questions( 22 )





Google
 
Web mainframegurukul.com









 
Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap    || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1   ||  DB2 Interview questions   || JCL Interview Questions   || COBOL Interview Questions   || VSAM Interview Questions   || CICS Interview Questions   || < simple DB2 SQL tutorial



Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Copyright ? 2005 mainframegurukul.com. All rights reserved

COBOL.html