Table of contents
1.
Introduction
2.
Mainframe Interview Questions for Freshers
2.1.
1. What are mainframe computers?
2.2.
2. What do you mean by mainframe testing?
2.3.
3. Name the various attributes of mainframe computing.
2.4.
4. What is COBOL?
2.5.
5. What do you mean by spool?
2.6.
6. What is DRDA?
2.7.
7. What is an UPDATE cursor?
2.8.
8. Explain the use of WHERE?
2.9.
9. What is JCL?
2.10.
10. What are the types of JCL statements?
2.11.
11. Name the different types of Table spaces?
2.12.
12. How is the LIKE table created?
2.13.
13. Name the divisions in a COBOL project?
2.14.
14. What is a foreign key?
2.15.
15. What is a deadlock in DB2?
2.16.
16. What is the use of DBCTL?
2.17.
17. Explain referential integrity?
2.18.
18. What is lock contention?
2.19.
19. What is a Database Descriptor?
2.20.
20. What is the use of the linkage section?
2.21.
21. What is an alias?
2.22.
22. What is the difference between dynamic SQL and static SQL?
2.23.
23. How dynamic and static linking is achieved?
3.
Mainframe Interview Questions for Experienced
3.1.
24. How is the EXIT PROGRAM used?
3.2.
25. What are the different types of locks?
3.3.
26. What is the isolation level?
3.4.
27. What is binary search?
3.5.
28. State all file OPEN modes?
3.6.
29. What is index cardinality?
3.7.
30. How is the Type-2 index superior?
3.8.
31. Explain the difference between index and subscription.
3.9.
32. What are clusters?
3.10.
33. How to handle deadlock in the DB2 program?
3.11.
34. What is paging?
3.12.
35. What is a SOC-7 error?
3.13.
36. What is COMP SYNC?
4.
Mainframe Scenario Based Interview Questions
4.1.
37. You receive a JCL error stating "JOB NOT RUN - JCL ERROR". What steps would you take to troubleshoot this issue?
4.2.
38. How would you handle a situation where a batch job is running longer than expected?
4.3.
39. A COBOL program is abending with a S0C7 error. How would you diagnose and resolve this problem?
4.4.
40. A COBOL program is showing incorrect data. How would you go about debugging it?
4.5.
41. You notice that a batch job is running much slower than usual. What steps would you take to investigate and improve its performance?
4.6.
42. How would you optimize the performance of a DB2 query that is running slowly?
4.7.
43. A user reports that they can't access a particular dataset. How would you troubleshoot this access issue?
4.8.
44. Describe how you would recover from a mainframe system crash.
4.9.
45. During a CICS transaction, users are experiencing slow response times. How would you approach this performance issue?
4.10.
46. How would you handle a deadlock situation in a DB2 environment?
5.
Mainframe MCQ
5.1.
1. Which utility is used to define VSAM datasets?
5.2.
2. What does the S0C7 abend code indicate?
5.3.
3. What is the purpose of the PERFORM statement in a COBOL program?
5.4.
4. Which JCL statement is used to execute a program?
5.5.
5. In CICS, which command retrieves data from a terminal?
5.6.
6. What does the TERMID parameter in CICS define?
5.7.
7. Which DB2 component is responsible for locking and unlocking resources?
5.8.
8. In JCL, what does the DISP=MOD keyword indicate?
5.9.
9. Which of the following is a COBOL compiler option?
5.10.
10. What is the purpose of the SYSOUT parameter in JCL?
6.
Conclusion
Last Updated: Sep 23, 2024
Medium

Mainframe Interview Questions and Answers

Author Manish Kumar
3 upvotes
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Mainframe computers are now considered legacy technology as these first came into existence in the early 1950s. These days mainframe computers have become sophisticated and powerful in handling extensive calculations and data processing. While appearing for an interview, you will require in-depth knowledge of Mainframe Interview Questions. 

This article covers some of the most frequently asked Mainframe interview questions and answers. The aim is to get you comfortable with the most important questions so that you sail through the interview flawlessly.
 

Mainframe interview Questions

 

Mainframe Interview Questions for Freshers

This section will get the basic mainframe interview questions to build a solid foundation. This section is crucial since it establishes a strong base. 

1. What are mainframe computers?

Ans: Mainframe computers are large refrigerator-sized computers used primarily by big organisations for complex calculations and extensive data computation. These computers consist of different processors and RAM and handle data on the scale of petabytes.

 

2. What do you mean by mainframe testing?

Ans: It refers to the testing of computer code services and applications. Mainframe testing aims to secure the performance, dependability and quality of software application and service by verification and validation methods and see if it is ready to deploy. 
 

3. Name the various attributes of mainframe computing.

Ans: Among the many characteristics of mainframe computing are:

  • High processing speed: Mainframes can process huge amounts of data quickly. This is because of their potent processors, abundant memory, and effective I/O systems.
     
  • High availability: Mainframes are made to be extremely available, which entails little to no downtime over extended periods of time. For companies that depend on mainframes for crucial applications, this is significant.
     
  • Mainframes can be scaled up or down to accommodate a business's changing demands. To achieve this, you can add or remove CPUs, memory, and storage.
     
  • Security: Mainframes have protections that safeguard data from unauthorised access, modification, and destruction. They are very secure systems.

4. What is COBOL?

Ans: It is the abbreviation for Common Business Oriented Language. It is a procedural, object-oriented and imperative language. Governments and companies use it for administrative and business purposes.
 

5. What do you mean by spool?

Ans: Spool extends to Simultaneous Peripheral Operations On-Line. It is a buffering mechanism in which data is temporarily stored to be used and executed–spooling works in a way that collects data, processes and instructions from numerous sources for execution later on.
 

6. What is DRDA?

Ans: DRDA is the abbreviation for Distributed Relational Database Architecture. It is a connection protocol for RDBMS processing. IBM and other vendors use DRDA. It contains rules for communication between a remote RDBMS and the application.
 

7. What is an UPDATE cursor?

Ans: UPDATE cursor allows us to delete or modify the currently selected row. The UPDATE keyword lets the server know it will alter the fetched row.
 

8. Explain the use of WHERE?

Ans: The “WHERE” clause separates an element or row whenever used with a relational statement.

Example :

SELECT EMPNO then FROM EMP;
WHERE PROJECT IS NULL;

 

9. What is JCL?

Ans: JCL or Job Control Language, this language controls jobs. On the IBM mainframe operating system, a scripting language called JCL is used to give instructions to the system for a batch process. It is a collection of instructions you program to inform the operating system of the action you wish to take. 
 

10. What are the types of JCL statements?

Ans: There are three types of JCL statements:
→ Work unit identifying statements that identify work to be done by the Operating System.
→ EXEC statement, which depends on the number of stages involved in running a job.
→ Data Definition statements are meant to identify input and output data sets.
 

11. Name the different types of Table spaces?

Ans: There are multiple types of tablespaces:

  • A basic table space is one that is not split or divided into sections. It is the most basic kind of table area and is frequently utilised for little tables.
     
  • Table space that has been partitioned: A partitioned table space has two or more partitions. A separate disc or disc drive can be used to store each partition. Performance and availability can be increased by using partitioned table spaces.
     
  • Table space separated into two or more segments is referred to as a segmented table space. Data from one or more tables may be included in each segment. To increase efficiency and make better use of available space, segmented table areas might be used.

12. How is the LIKE table created?

Ans: The table is created by using the CREATE method and using the like parameter. These tables are generally used for testing purposes.

 

13. Name the divisions in a COBOL project?

Ans: Identification, environment, data, and procedure are the four divisions in a COBOL project.
 

14. What is a foreign key?

Ans: A foreign key is the reference of the primary key of another table. It helps to establish a relationship between two tables. 

Foreign Key Diagram

15. What is a deadlock in DB2?

Ans: When two autonomous processes compete for the same resource or the resources reserved by one another, it is called a deadlock. -911 and -913 are the SQL code for a deadlock.
 

16. What is the use of DBCTL?

Ans: The DBCTL region is like the IMS Transaction Manager without the support for terminals or message queues. It is used to access IMS files for CICS Transactions and their address space. The DBCTL environment has only IMS DB installed.
 

17. Explain referential integrity?

Ans: It is a property of data stating that all its references are valid. Relational databases need that if a value of one attribute of a relation references a value of another attribute, then the referenced value must exist.
 

18. What is lock contention?

Ans: Lock contention is when more than one object aims to get executed simultaneously as DBD permits admission to one thing at a particular time. It occurs when one process or thread tries to obtain a lock held by another. 
 

19. What is a Database Descriptor?

Ans: Database Descriptor (DBD) restricts access to the database whenever an object is created, modified or deleted.
 

20. What is the use of the linkage section?

Ans: The linkage section allows the insertion of data from outside the program. Either it is part of the parameter in JCL or called from another program. All data is passed through the linkage section only.
 

21. What is an alias?

Ans: It is an alternate name for database objects. You can say it acts as the nickname of DB objects. Alias is defined for the objects to make their name brief, thereby diminishing the query size and increasing the readability of the query.
 

22. What is the difference between dynamic SQL and static SQL?

Ans:  An SQL statement can be created and executed dynamically at runtime. This implies that the statement could be altered depending on input from the user or other factors. Applications that need to be flexible and adaptable frequently use dynamic SQL.

A sort of SQL statement that is hard-coded into an application is known as static SQL. As a result, the statement cannot be altered during execution. Applications where performance is crucial frequently utilise static SQL since the database optimizer can precompile and optimise the statement.

23. How dynamic and static linking is achieved?

Ans: Dynamic linking reduces total resource consumption and automatically ships bug fixes and improvements. Static linking allows code to run in limited environments, making binaries easy to distribute to diverse user environments.

Mainframe Interview Questions for Experienced

This section will discuss some of the more challenging Mainframe Interview Questions. While knowing easy and medium-level questions is necessary, the more complicated questions will set you above other candidates in the interview. Let us go through some of the more difficult Mainframe Interview Questions.

24. How is the EXIT PROGRAM used?

Ans: The EXIT PROGRAM statement in COBOL is used to stop a program's execution and give control back to the calling programme or operating system. It frequently works with the CALL statement to end a called program's execution and continue it in the calling program. This claim is especially helpful when modular programming divides difficult tasks into manageable, reusable programs.

25. What are the different types of locks?

Ans: The three types of locks are shared, updated, and exclusive:

→ Shared Lock: After acquiring a shared lock on a page, the application can read that page but cannot update it. Other applications can concurrently acquire shared or update lock on the same page.

→ Updated Lock: It is the same as the shared lock but in order to update the applications need to be promoted to exclusive lock status. Other concurrent processes can only place shared locks. 

→ Exclusive Lock: If an application acquires an exclusive lock then it can read as well as update it. Other concurrent applications cannot place any lock.
 

26. What is the isolation level?

Ans: It measures the degree to which the activation group in focus is isolated from other active groups in action.
 

27. What is binary search?

Ans: It is a searching technique that runs in logarithmic time. It searches for an element by rejecting one-half of the search space, thus reducing the length by half in each iteration. It needs sorted data to work.
 

28. State all file OPEN modes?

Ans: The four file OPEN modes are:

  • INPUT
  • OUTPUT
  • EXTEND
  • I/O

29. What is index cardinality?

Ans: The cardinality of a user-defined function is the number of rows that are returned when the process is invoked. DB2 uses this number to calculate the cost of executing a query that summons a user-defined table function.
 

30. How is the Type-2 index superior?

Ans: A Type-2 index, also known as a composite or compound index, combines several columns to produce an index structure that is more adaptable and effective.  It is superior in the following ways:

  • Improved Query Performance: Type-2 indexes help the database locate particular values more rapidly, speeding up queries that use many columns.
  • Reduced Storage Overhead: A Type-2 index uses less storage space than several single-column indexes, which improves database performance and upkeep.
  • Improved Sorting and Filtering: A Type-2 index allows faster and more effective sorting and filtering operations on many columns, optimising query execution.
  • Minimised Index Maintenance: Type-2 indexes reduce the frequency of maintenance jobs such index rebuilds and updates, which improves database performance and lowers overhead.
     

31. Explain the difference between index and subscription.

Ans: An index is a type of data structure used in databases that accelerates data retrieval operations on database tables. To enable the database system to easily find and access the required rows, it operates by constructing a sorted list of column values. Indexes are used to optimise query execution.

Regular updates or content from a source, such as a publication, website, or streaming service, are often provided to users or entities through the usage of a subscription service or agreement. It has to do with giving subscribers access to material or information, not database indexing.

32. What are clusters?

Ans: A cluster is a combination of the sequence set, index and data portions in the Data set. Operating System gives access to the program cluster, and this allows access to be granted to all parts of the Dataset simultaneously.
 

33. How to handle deadlock in the DB2 program?

Ans: Deadlock occurs when two programs get an exclusive lock on the same resource, which can’t be rendered until data is accessed. To resolve the error, you can roll back to the current work unit of any of the processes and terminate the program after the preset time elapses.

34. What is paging?

Ans: It is a storage management technique by which computers efficiently bring the data stored in secondary memory to main memory. In this technique, the operating system fetches data from secondary storage in same-size blocks called pages.

35. What is a SOC-7 error?

Ans: SOC -7 errors occur in mainframes because of a variable holding data that it is not intended to hold. For example, if a character type variable has numeric data, then a SOC-7 error occurs.
 

36. What is COMP SYNC?

Ans: It causes the items to be aligned to natural boundaries. It can synchronise left or right. For binary data objects, the address resolution is faster if they are located at word boundaries in the memory.

Mainframe Scenario Based Interview Questions

37. You receive a JCL error stating "JOB NOT RUN - JCL ERROR". What steps would you take to troubleshoot this issue?

  1. Review the job log for specific error messages.
  2. Check for syntax errors in the JCL, such as missing semicolons or misspelled keywords.
  3. Verify that all referenced datasets exist and are accessible.
  4. Ensure that the job has the necessary authority to access resources.
  5. If needed, consult with the systems programmer for more complex issues.

38. How would you handle a situation where a batch job is running longer than expected?

In this case, I would first check the system logs (records of events in the system) to identify any bottlenecks (points of delay), such as high CPU usage or I/O (input/output) waits. I would also review the job’s parameters (settings) to ensure it has enough resources. If needed, I could optimize the code or break the job into smaller parts to improve performance.

39. A COBOL program is abending with a S0C7 error. How would you diagnose and resolve this problem?

  1. Identify the line where the abend occurs using the program dump.
  2. Check for arithmetic operations on non-numeric data.
  3. Verify that all variables are properly initialized.
  4. Ensure that no decimal point alignment issues exist in calculations.
  5. Use debugging tools like XPEDITER to step through the code and inspect variable values.
  6. If necessary, add additional error handling or data validation to prevent future occurrences.

40. A COBOL program is showing incorrect data. How would you go about debugging it?

To debug a COBOL (Common Business-Oriented Language) program, I would start by checking the input files and logs to ensure the correct data is being processed. I would use tools like Abend-AID (a tool for analyzing errors) or Xpediter (a debugging tool) to follow the program's flow, identify logic errors, and correct any bugs.

41. You notice that a batch job is running much slower than usual. What steps would you take to investigate and improve its performance?

  1. Review the job log to identify any unusual wait times or resource constraints.
  2. Check system utilization during job execution to see if there are any system-wide performance issues.
  3. Analyze the job's SQL statements for potential optimization opportunities.
  4. Review any recent changes to the job or related data that might impact performance.
  5. Consider using utilities like DB2 EXPLAIN to analyze query execution plans.
  6. If applicable, optimize VSAM file access or consider using alternate access methods.
  7. Consult with the database administrator for potential indexing or partitioning strategies.

42. How would you optimize the performance of a DB2 query that is running slowly?

To improve a DB2 (IBM's database management system) query, I would review the SQL query for inefficiencies such as unnecessary joins or subqueries (parts of the query). I would also analyze the query’s execution plan (how the query is processed) and apply indexing (organizing data to speed up searches) if necessary.

43. A user reports that they can't access a particular dataset. How would you troubleshoot this access issue?

  1. Verify the user's credentials and ensure they have the necessary permissions.
  2. Check the dataset properties to confirm it exists and is not allocated to another job.
  3. Review the security settings (e.g., RACF profiles) for the dataset.
  4. Examine any error messages in the user's session log.
  5. If applicable, check for any issues with the catalog or VTOC.
  6. Verify that the dataset is not on an offline or unavailable volume.
  7. If needed, work with the security team to grant appropriate access.

44. Describe how you would recover from a mainframe system crash.

If a mainframe system crashes, I would follow the disaster recovery plan. This includes identifying the cause, restoring the system from backups, and ensuring critical services are running. I would review the logs to determine the root cause and take steps to avoid future crashes.

45. During a CICS transaction, users are experiencing slow response times. How would you approach this performance issue?

  1. Use CICS monitoring tools to identify the specific transaction causing the slowdown.
  2. Analyze transaction statistics to determine if it's a CPU, I/O, or wait time issue.
  3. Review the transaction's program logic for any potential bottlenecks.
  4. Check for any resource contention issues, such as enqueues or database locks.
  5. Examine the DB2 access patterns and optimize SQL if necessary.
  6. Consider adjusting CICS system parameters or transaction class settings.
  7. If applicable, review network latency between the user and the mainframe.

46. How would you handle a deadlock situation in a DB2 environment?

In a deadlock (when two transactions block each other) situation, I would analyze DB2 logs to identify the conflicting transactions. I would resolve the issue by adjusting the locking behavior or modifying the transactions to reduce lock times.

Mainframe MCQ

1. Which utility is used to define VSAM datasets?

A) IEBGENER

B) IDCAMS

C) DFSORT

D) IEBCOPY

Answer: B) IDCAMS

2. What does the S0C7 abend code indicate?

A) Divide by zero

B) Invalid address

C) Data exception

D) End of file

Answer: C) Data exception

3. What is the purpose of the PERFORM statement in a COBOL program?

A) To define variables

B) To call subroutines

C) To execute a loop or procedure

D) To read files

Answer: C) To execute a loop or procedure

4. Which JCL statement is used to execute a program?

A) EXEC

B) DD

C) JOB

D) DISP

Answer: A) EXEC

5. In CICS, which command retrieves data from a terminal?

A) RECEIVE

B) SEND

C) WRITE

D) READ

Answer: A) RECEIVE

6. What does the TERMID parameter in CICS define?

A) Transaction ID

B) Terminal ID

C) File ID

D) User ID

Answer: B) Terminal ID

7. Which DB2 component is responsible for locking and unlocking resources?

A) Data Manager

B) Lock Manager

C) Resource Manager

D) Transaction Manager

Answer: B) Lock Manager

8. In JCL, what does the DISP=MOD keyword indicate?

A) Create a new dataset

B) Append to an existing dataset

C) Delete a dataset

D) Use the dataset in readonly mode

Answer: B) Append to an existing dataset

9. Which of the following is a COBOL compiler option?

A) CICS

B) NOSSRANGE

C) RESTART

D) SYSOUT

Answer: B) NOSSRANGE

10. What is the purpose of the SYSOUT parameter in JCL?

A) To define the input dataset

B) To specify output location

C) To control job execution

D) To allocate memory

Answer: B) To specify output location

Conclusion

In this article, we have discussed mainframe interview questions. Mainframes continue to play a crucial role in handling large-scale transactions and data processing in finance, healthcare, and government industries. Preparing for a mainframe interview requires a deep understanding of both the technical aspects of mainframe systems and the ability to solve real-world challenges. 

After reading about the mainframe interview questions, are you not feeling excited to read/explore more articles on other interview-related articles? Don't worry; Coding Ninjas has you covered: Unix Interview Questions, Operating System Interview QuestionsJCL Interview Questions, Network Security Interview Questions, MongoDB Interview Questions.

Recommended Readings:

Refer to our Guided Path on Code360 to upskill yourself in Data Structures and AlgorithmsCompetitive ProgrammingJavaScriptSystem Design, and many more! If you want to test your competency in coding, you may check out the mock test series and participate in the contests hosted on Code360. But suppose you have just started your learning process and are looking for questions asked by tech giants like Amazon, Microsoft, Uber, etc. In that case, you must look at the problemsinterview experiences, and interview bundle for placement preparations.

Nevertheless, you may consider our paid courses to give your career an edge over others!

Do upvote our blogs if you find them helpful and engaging!

Happy Learning!

Live masterclass