Cursors: Static and Dynamic
Understand why COBOL needs cursors to process multi-row SQL result sets and the difference between static and dynamic cursor definitions.
COBOL has no native concept of a result set — every embedded SQL statement either returns exactly one row (via SELECT INTO) or, for anything that could return multiple rows, must be processed through a cursor, which acts as a pointer that steps through a result set one row at a time. This is one of the first genuinely DB2-specific (rather than general SQL) concepts a COBOL developer must internalize, and interviewers ask about it constantly because nearly every batch DB2 program that processes more than a handful of known rows uses one.
A cursor is a librarian's bookmark moving through a shelf of matching books one at a time on request — a static cursor knows exactly which shelf to search before the day even starts, while a dynamic cursor gets handed a search request written on the fly and has to figure out where to look right then.