Cobol Test 1 - Interview Questions

cobol interview questions

Moderator: Moderator Group

Post Reply
ballaravi@gmail.com
Member
Posts: 16
Joined: Fri Jun 25, 2010 10:50 am

Cobol Test 1 - Interview Questions

Post by ballaravi@gmail.com » Wed Sep 08, 2010 5:58 pm

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

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Thu Sep 09, 2010 1:01 pm

It would be nice if you tell us what were your answers?
Regards,
Anuj

arivu
Member
Posts: 2
Joined: Wed Aug 04, 2010 6:33 pm
Location: chennai

Post by arivu » Tue Sep 14, 2010 12:50 pm

i want many questions tis type...send me now.....
arivu

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Sep 14, 2010 4:51 pm

arivu wrote:i want many questions tis type...send me now.....
Have sent them across via courier!
Regards,
Anuj

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Tue Sep 14, 2010 5:06 pm

ballaravi@gmail.com,

as Anuj said, the behavior on this board is to post your questions and your answers.

if you have no answers, suggest you start reading the manuals.
all but a couple can be found within a minute or so.
a couple of the questions require some thought.

and, why do you expect anyone to take their time to read your run-on-sentences and poorly formatted questions?
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

ballaravi@gmail.com
Member
Posts: 16
Joined: Fri Jun 25, 2010 10:50 am

Post by ballaravi@gmail.com » Wed Sep 15, 2010 9:17 am

Means if i answer this questions, can u tell me it is correct or not
Thank You

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Wed Sep 15, 2010 1:33 pm

maybe.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Wed Sep 15, 2010 3:05 pm

ballaravi@gmail.com wrote:Means if i answer this questions, can u tell me it is correct or not
Yes, I (we?) can try.
Regards,
Anuj

ballaravi@gmail.com
Member
Posts: 16
Joined: Fri Jun 25, 2010 10:50 am

COBOL TEST-1 ANS

Post by ballaravi@gmail.com » Thu Dec 02, 2010 4:32 pm

I KEPT BY ANSWERS IN BOLD, IF I AM INCORRECT,PLEASE CORRECT ME


(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

Shivankoo
Member
Posts: 14
Joined: Mon Dec 13, 2010 4:15 pm

Post by Shivankoo » Fri Aug 17, 2012 8:46 am

I think for question 13 the answer should be 1 that the sign bit is stored in the last nibble of the last byte.
Thanks and Regards
Shivankoo Sharma

//EMPIRE EXEC PGM=WIFE
//SYSIN DD DSN=VARSHA.ME.HOME,DISP=SHR
//SYSOUT DD DUMMY

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Fri Aug 17, 2012 4:42 pm

Yes, for question 13, "a" is the correct option as you've indicated. However, it's been nearly 2 years when the original question was posted.

Unfortunately, there was no follow up from OP and the thread was left unattended even by us, after a promise...:oops:
Regards,
Anuj

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Fri Aug 17, 2012 7:59 pm

(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 >>incorrect
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

anu alexander
Member
Posts: 6
Joined: Fri Jul 05, 2013 7:52 pm

Post by anu alexander » Mon Jul 08, 2013 10:48 am

i think for 15th question the answer is 'a'

academyindia4

Topic deleted by Admin

Post by academyindia4 » Thu Jan 21, 2016 12:18 pm

<< Content deleted By Admin >>

Post Reply