100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Programming

COBOL Interview Questions

The core language, file-handling, and mainframe concepts most frequently asked in COBOL developer interviews, with the reasoning behind each answer.

PracticeIntermediate10 min readJul 10, 2026
Analogies

Core Language Fundamentals

Interviewers frequently probe whether a candidate understands COBOL's four divisions (IDENTIFICATION, ENVIRONMENT, DATA, PROCEDURE) and the difference between WORKING-STORAGE (initialized once, persists for the program's life) and LOCAL-STORAGE (reinitialized on every call, useful for reentrant CICS programs). A classic follow-up asks candidates to explain the difference between COMP, COMP-3, and DISPLAY usage, since choosing the wrong one affects both storage size and arithmetic performance.

🏏

Cricket analogy: It's like asking a player to explain the difference between a Test match, ODI, and T20 format — each COBOL division/usage clause is a distinct 'format' with its own rules that a real practitioner must instantly distinguish.

File Handling and Data Structures

A very common interview question asks candidates to explain sequential, indexed (VSAM KSDS), and relative file organizations, and when each is appropriate — sequential for month-end batch reports processed start to finish, indexed for random-access lookups by account number, relative for fixed-size records accessed by a known relative record number such as a slot-based queue. Candidates should also be ready to explain REDEFINES (overlaying one data item's storage with another interpretation) and OCCURS (defining a repeating table structure, the COBOL equivalent of an array).

🏏

Cricket analogy: It's like explaining the difference between reading a full Test match scorecard ball-by-ball (sequential), looking up a specific player's stats instantly from an index (indexed/VSAM), and finding the batsman at position 4 in the lineup directly (relative).

cobol
       01  WS-EMPLOYEE-RECORD.
           05  WS-EMP-ID          PIC 9(6).
           05  WS-EMP-TYPE        PIC X(1).
           05  WS-EMP-DETAILS     PIC X(30).
           05  WS-SALARY-INFO REDEFINES WS-EMP-DETAILS.
               10  WS-BASE-SALARY PIC 9(7)V99 COMP-3.
               10  WS-BONUS       PIC 9(5)V99 COMP-3.
           05  WS-MONTHLY-SALES OCCURS 12 TIMES
                                 PIC 9(7)V99 COMP-3.

A strong candidate answer on REDEFINES vs. OCCURS: REDEFINES gives two different views of the SAME storage (like a union in C), while OCCURS creates a repeating table of the same structure (like an array). Confusing the two, or claiming REDEFINES allocates new memory, is a common red flag in interviews.

CICS, DB2, and Mainframe Concepts

For roles touching online systems, interviewers ask about the CICS command-level interface (EXEC CICS ... END-EXEC), pseudo-conversational programming (where a transaction releases control between user screen interactions to free up resources for other users rather than holding a thread), and embedded SQL via EXEC SQL for DB2 access, including how SQLCODE is checked after every statement (0 for success, +100 for not found, negative values for errors).

🏏

Cricket analogy: Pseudo-conversational CICS is like a bowler who doesn't hold the ball between deliveries — they hand it back to the umpire between overs so other things can happen, rather than monopolizing the crease indefinitely.

A frequent interview trap: candidates say SQLCODE = 0 means 'the query ran.' The correct, precise answer is SQLCODE = 0 means success, +100 specifically means no rows found (not an error), and negative values indicate an actual error — interviewers use this to check whether a candidate has really written production DB2-COBOL code.

Behavioral and Scenario Questions

Beyond syntax, senior COBOL interviews probe real production judgment: 'Walk me through how you'd debug an S0C7 abend from a dump' (check the offset in the dump against the compile listing to find the offending MOVE/COMPUTE, then trace the source field back through the file or screen it came from), or 'How would you safely add a new field to a 30-year-old copybook used by 200 programs' (append at the end rather than inserting in the middle, to avoid shifting offsets in every program that references fields after the insertion point).

🏏

Cricket analogy: It's like asking a captain to explain a real match-turning decision, not just recite the laws of cricket — interviewers want to see the reasoning behind a real S0C7-style crisis, not textbook definitions.

  • Know the four COBOL divisions and the difference between WORKING-STORAGE and LOCAL-STORAGE.
  • Be able to explain COMP, COMP-3, and DISPLAY usage trade-offs precisely.
  • Understand sequential, indexed (VSAM), and relative file organizations and when to use each.
  • Explain REDEFINES as storage overlay and OCCURS as a repeating table, not synonyms.
  • Know pseudo-conversational CICS design and why it conserves server resources.
  • Check SQLCODE precisely: 0 is success, +100 is not-found, negative is an error.
  • Practice explaining real debugging scenarios like S0C7 abends and copybook change strategy.

Practice what you learned

Was this page helpful?

Topics covered

#Programming#COBOLStudyNotes#COBOLInterviewQuestions#COBOL#Interview#Questions#Core#StudyNotes#SkillVeris#ExamPrep