Top Mainframe Interview Questions (Part-3)

The following are the set of questions asked in COBOL, JCL and DB2

COBOL Questions:

Q1). How to write ‘SRINI’ as ‘INIRS’?

A1) Use function “REVERSE”

Q2). What is String and Unstring in COBOL?

A2). String – To concatenate multiple data fields into a single string

Unstring- To split main string, to get only particular string

JCL Questions:

Q1). How to override DD name of proc?

//step1 exec proc
//procstep.data1  dd  dsn=xyz

Q2). Difference between Steplib, Jcllib, JOBlib?

Steplib- It applies for only that particular step

Joblib – It applies to whole job

JCLlib- It has proc libraries, include members etc

//jcllib order=test.proclib

Q3). What is Cond=(4,LT) at step?

It validates previous step return code. If true, step will be bypassed. If false, step will be executed.

DB2 SQL Questions:

Q1) Write Cursor flow?

  • Declare cursor
  • Open cursor
  • Fetch cursor
  • Close Cursor

Q2) Write  a query to get max salary?

Select max(salary) from emp_table

Q3) Write a query to get nth highest salary?

Select distinct salary from emp1 e1  where
n = (select count(distinct salary) from emp1 e2 where
e1.salary <= e2.salary)


  1. A, C; 2. D; 3. E; 4.B; 5. A, D



Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.

Comments are closed.