Joined: 20 Oct 2006 Posts: 6970 Location: porcelain throne
Though what you were taught is technically correct,
most professionals perform the necessary i/o and service calls
to close things that their program opened.
In batch, if you have a sub-module that has been processing a cursor,
and you do not explicitly close the cursor in that module,
the cursor is not closed until the run-unit is finished. If you call the submodule again to process another instance of the cursor, you encounter an error when you attempt to open it the 2nd time - it is open, already.
Closing a cursor releases db2 resources, when you close the cursor.
Same goes for COMMITs. At the end of a run-unit, the ops-system will commit everything for you, if you do not have a program abend.