---
title: "Top Mainframe Interview Questions (1 of 3)"
description: "The complex mainframe questions that are asked recently in an interview given here for your ready reference."
url: https://srinimf.com/2015/03/12/top-mainframe-interview-questions/
date: 2015-03-12
modified: 2025-04-26
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2015/03/pexels-photo-5668869.jpeg?fit=1880%2C1253&ssl=1
categories: ["Categories", "Mainframe Interview Questions"]
tags: ["Interview Questions"]
type: post
lang: en
---

# Top Mainframe Interview Questions (1 of 3)

The subsequent primary interview questions related to COBOL, JCL, and DB2 for mainframe positions.

## **COBOL interview 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)
```

**SQL QUIZ ANSWERS**

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

[SQL QUIZ LInks](http://srinimf.com/2015/07/02/db2-sql-quiz-for-mainframe-programmers/)

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2015%2F03%2F12%2Ftop-mainframe-interview-questions%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2015%2F03%2Fpexels-photo-5668869.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=Top%20Mainframe%20Interview%20Questions%20%281%20of%203%29)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2015/03/12/top-mainframe-interview-questions/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2015/03/12/top-mainframe-interview-questions/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2015/03/12/top-mainframe-interview-questions/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2015/03/12/top-mainframe-interview-questions/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20Top%20Mainframe%20Interview%20Questions%20%281%20of%203%29&body=https%3A%2F%2Fsrinimf.com%2F2015%2F03%2F12%2Ftop-mainframe-interview-questions%2F&share=email)
-

### Like this:

Like Loading…
