Hi Friends this Vijai , I recently attend a Mainframe interview in Chennai. I share some Mainframe interview questions With you, What I re...
Hi Friends this Vijai, I recently attend a Mainframe interview in Chennai. I share some Mainframe interview questions With you, What I remember …….
COBOL Questions:
1. Program name: P1.
Load library: TRGF99.COBOL.LOADLIB
Input File: TRGF99.FILE1
Output File: TRGF99.OUTFILE
//JOB1 JOB 124
//STEP01 EXEC PGM=P1
//STEPLIB DD DSN=TRGF99.COBOL.LOADLIB1,DISP=SHR
//INFILE DD DSN=TRGF99.FILE1,DISP=SHR
//OUTFILE DD DSN=TRGF99.OUTFILE,DISP=MOD
In the above scenario, if we execute the above program which one of the following errors we get?
1. Program name: P1.
Load library: TRGF99.COBOL.LOADLIB
Input File: TRGF99.FILE1
Output File: TRGF99.OUTFILE
//JOB1 JOB 124
//STEP01 EXEC PGM=P1
//STEPLIB DD DSN=TRGF99.COBOL.LOADLIB1,DISP=SHR
//INFILE DD DSN=TRGF99.FILE1,DISP=SHR
//OUTFILE DD DSN=TRGF99.OUTFILE,DISP=MOD
In the above scenario, if we execute the above program which one of the following errors we get?
a) S806 b)SE37 c)S0C4 d)S0C7
-------------------------------------------------------------------------------------------
2. If ‘MAINPGM’ is a COBOL program that calls another program ‘LINKPGM’ and passes a value say, ‘10’, that value will be accepted by another variable in link program. Where that variable is declared?
a) Working Storage Section of MAINPGM
b) Linkage Section of MAINPGM
c) Linkage Section of LINKPGM
d) Working Storage Section of LINKPGM
e) Both b & d
---------------------------------------------------------------------------------------
3. A file attribute mismatch was encountered. Which of the following status code is related to the above message?
a)35 b)39 c)46 d)90
---------------------------------------------------------------------------------------
4. Which of the following divisions are mandatory
i) IDENTIFICATION
ii) ENVIRONMENT
iii) DATA
iv) PROCEDURE
a) i only b) i & ii c) iv only d) i & iv e) iii & iv
-------------------------------------------------------------------------------------------
5. 01 WS-ABC PIC X.
88 FOUND VALUE ‘Y’.
88 NOT-FOUND VALUE ‘N’.
What is the error in the above code?
a) PIC clause is missing in the FOUND declaration.
b) PIC clause is missing in the NOT-FOUND declaration.
c) 88 level variables are declared in Area-A.
d) 01 level variable is declared in Area-A.
-------------------------------------------------------------------------------
6. Every file entry in the File Control should have a description in the File Section.
a) True b) False
-----------------------------------------------------------------------------------
7. IF A>B
IF A>C
DISPLAY ‘A’
NEXT SENTENCE
END-IF
DISPLAY ‘C’
END-IF.
DISPLAY ‘B’.
If A=10, B=5, C=7. What is the output?
a) A C B b) A B c) B d) C B
------------------------------------------------------------------------------------------
8. What is the statement that is used to stop the execution of the program?
a) GOBACK b) EXIT c) STOP RUN d) EXIT
--------------------------------------------------------------------------------------------
9. MAIN-PARA
DISPLAY ‘IN MAIN-PARA’.
PERFORM PARA1 THRU PARA2.
STOP RUN.
PARA1.
DISPLAY ‘IN PARA1’.
PARA3.
DISPLAY ‘IN PARA3’.
PARA2.
DISPLAY ‘IN PARA2’.
Assume that the above code is in the PROCEDURE DIVISION of a COBOL program. If the above program is executed, what is the output?
a) IN MAIN-PARA b) IN MAIN-PARA c) IN MAIN-PARA
IN PARA1 IN PARA1 IN PARA1
IN PARA2 IN PARA3 IN PARA2
IN PARA2 IN PARA3
d) Compilation Error as Para-names are not declared in a proper order.
---------------------------------------------------------------------------------
10. Can we move a variable containing Alphanumeric value to a variable containing Numeric value?
a) Yes b) No
-----------------------------------------------------------------------------------
11. How many bytes are required to store data internally for a variable defined as PIC 9(7)V99 USAGE COMP-3.
a) 4 b) 5 c) 6 d) 9
---------------------------------------------------------------------------------
12. Find the number of bytes which will be stored in the variable EMP-RECORD
01 EMP-RECORD.
02 EMP-DATA1.
03 EMP-NAME PIC X(10).
03 EMP-SAL PIC 9(04).
02 EMP-DATA2 REDEFINES EMP-DATA1.
03 EMP-N1 PIC X(12).
03 EMP-N2 PIC 9(02).
02 EMP-DATA3.
03 DEPT1 PIC X(02).
03 DEPT2 PIC X(02).
a) 14 b) 16 c) 18 d) 32
-------------------------------------------------------------------------------------
13. A PIC 9(2)V9(3) VALUE 10.121
B PIC 9(2) VALUE 12
C PIC 9(2)V99 VALUE 11.23
What will be the value in C after the following statement is executed
ADD A, B GIVING C ROUNDED
a) 22.121 b) 22.12 c) 22.13 d) 11.23
7 comments
nice blog thanks company jobs
Mainframe interview questions and answers are helpful for me. I like this tips.
Good list.SOme explanation to each question would have really helped.
Sreenivas,
http://clearmainframeinterview.blogspot.com/
Good list.
For real time scenario based Mainframe interview questions,please refer
WWW.MAINFRAMEINTERVIEW.COM
question number 4.
ur ans is worng.
bcoz without procedure division why i need to declare identification division.it is meaningless.so identification and procedure division both are mandatory.
File Status Code 39 would be a file attribute mismatch (Q3 - Ans B)
cobol allows alphanumeric to numberic only alphabetic move not allowed. yes we may get s0c7 for invalid values but you can check for IS NUMERIC and move.
Post a Comment