DB2 ⭐ Featured
👁 0

Q: When should I use COMMIT in DB2?

Answer:

COMMIT saves all changes since the last COMMIT and releases locks.

When to COMMIT:

  • After processing a logical unit of work
  • Periodically in long-running batch (every N records)
  • Before ending the program successfully

Frequency Guidelines:

  • Too frequent: Performance overhead
  • Too rare: Lock contention, large log
  • Typical: Every 100-1000 records in batch

Best Practice:

MOVE 0 TO WS-COMMIT-COUNT.

PERFORM PROCESS-RECORD.

ADD 1 TO WS-COMMIT-COUNT.
IF WS-COMMIT-COUNT >= 500
    EXEC SQL COMMIT END-EXEC
    MOVE 0 TO WS-COMMIT-COUNT
END-IF.

Note: In CICS, syncpoint (COMMIT) happens automatically at task end. Explicit SYNCPOINT is rarely needed.

DB2 ⭐ Featured
👁 0

Q: How to handle CLOB in COBOL?

Answer:
Declare: 01 CLOB-VAR SQL TYPE IS CLOB(1M). Or use LOB locator: 01 CLOB-LOC SQL TYPE IS CLOB_LOCATOR. FREE LOCATOR releases. DBMS_LOB procedures for manipulation. Large CLOBs need special handling.
VSAM ⭐ Featured
👁 0

Q: What is NOSCRATCH?

Answer:
NOSCRATCH on DELETE keeps data space. Entry removed from catalog but space not released. Rarely used. Normal DELETE releases space. May be useful for recovery scenarios.
JCL ⭐ Featured
👁 0

Q: Explain SPACE parameter options

Answer:
SPACE=(unit,(primary,secondary,directory)). Unit: TRK/CYL/block-size. Primary allocated first, secondary in 15 increments. Directory only for PDS. RLSE releases unused. CONTIG requires contiguous. Example: SPACE=(CYL,(10,5,20),RLSE)
VSAM ⭐ Featured
👁 0

Q: What is ERASE on DELETE?

Answer:
ERASE overwrites data with binary zeros. Physical erase before space release. Security requirement for sensitive data. Takes time. Without ERASE, data remains until overwritten.
CICS ⭐ Featured
👁 0

Q: How to use ENQ/DEQ?

Answer:
ENQ serializes resources. EXEC CICS ENQ RESOURCE(name) LENGTH(len). DEQ releases. Prevents concurrent access. NOSUSPEND returns immediately if busy. Use for data integrity.
JCL ⭐ Featured
👁 0

Q: What is FREE parameter?

Answer:
FREE specifies when to release allocation. FREE=END (default) at step end. FREE=CLOSE when file closed. FREE=CLOSE allows reuse within step. Reduces concurrent allocations. Helps resource-constrained systems.
JCL ⭐ Featured
👁 0

Q: What is RLSE subparameter?

Answer:
RLSE releases unused space at close. SPACE=(CYL,(10,5),RLSE). Returns unused secondary allocations. Good practice for new datasets. Saves disk space. May cause allocation issues if reextended.
DB2 ⭐ Featured
👁 0

Q: Explain COMMIT and ROLLBACK

Answer:
COMMIT makes changes permanent, releases locks. ROLLBACK undoes changes since last COMMIT. Implicit COMMIT at program end (normal). Implicit ROLLBACK on abend. Frequent COMMIT reduces lock duration and log usage.
COBOL
👁 0

Q: Explain CALL statement and parameters

Answer:
CALL invokes subprogram: CALL 'SUBPROG' USING param-1 param-2. BY REFERENCE (default) passes address. BY CONTENT passes copy. BY VALUE passes value (for C). ON EXCEPTION handles load failures. CANCEL releases memory.
VSAM
👁 0

Q: What is ERASE parameter?

Answer:
ERASE overwrites data on delete. DELETE CLUSTER ERASE. Security feature - data unrecoverable. Without ERASE, space released but data remains. Use for sensitive data.
CICS
👁 0

Q: What is GETMAIN?

Answer:
GETMAIN allocates temporary storage. EXEC CICS GETMAIN SET(pointer) LENGTH(size) INITIMG(X'00'). Returns pointer. Use for dynamic memory. FREEMAIN releases. SHARED for multi-task access. Automatic cleanup on task end.
JCL
👁 0

Q: What is SPIN parameter?

Answer:
SPIN=UNALLOC releases output immediately on step/job end. SPIN=(UNALLOC,step) at step end. Without SPIN, output held until job completes. Allows viewing long job output early. On DD SYSOUT statement.