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: What is dynamic SQL?

Answer:
Dynamic SQL constructed at runtime. PREPARE creates executable. EXECUTE runs it. EXECUTE IMMEDIATE for one-time. DECLARE CURSOR for queries. More flexible but less efficient than static. Security concerns (injection).
VSAM ⭐ Featured
👁 0

Q: What is VERIFY utility?

Answer:
VERIFY corrects catalog end-of-data after abend. IDCAMS VERIFY FILE(ddname). Recovers from improper close. Run if status 97 or catalog inconsistent. Should be run before processing after abnormal end.
COBOL ⭐ Featured
👁 0

Q: What is USE BEFORE REPORTING?

Answer:
In Report Writer, USE BEFORE REPORTING procedure runs before printing. USE BEFORE REPORTING report-group-name. Allows dynamic modification of report data. Can suppress or modify lines based on runtime conditions.
VSAM ⭐ Featured
👁 0

Q: What is EXAMINE utility?

Answer:
EXAMINE checks VSAM structural integrity. EXAMINE NAME(ds.name) INDEXTEST DATATEST. Finds problems in index, data. Run periodically or when problems suspected. Output shows errors.
VSAM ⭐ Featured
👁 0

Q: How to handle status 44?

Answer:
Status 44 is boundary violation on sequential WRITE. Record too large for file definition. Check RECORDSIZE parameter. May need variable length definition. Truncation doesn't happen automatically.
JCL ⭐ Featured
👁 0

Q: How to use //IF statement?

Answer:
//IF (condition) THEN executes following steps if true. Conditions: RC, ABEND, ABENDCC, RUN, STEP.RC. Example: //IF (STEP1.RC = 0) THEN ... //ENDIF. Can nest. ELSE available. Clearer than COND parameter.
CICS ⭐ Featured
👁 0

Q: Explain CICS regions

Answer:
CICS region is address space. TOR (Terminal Owning) owns terminals. AOR (Application Owning) runs programs. FOR (File Owning) owns files. MRO connects regions. Workload distribution.
CICS ⭐ Featured
👁 0

Q: Explain SUSPEND command

Answer:
SUSPEND yields control to other tasks. EXEC CICS SUSPEND. Allows multitasking. Task resumes when dispatched. Use sparingly. May help long-running tasks. Usually unnecessary.
DB2 ⭐ Featured
👁 0

Q: What is RUNSTATS and when to use it?

Answer:
RUNSTATS collects table/index statistics for optimizer. Run after significant data changes (loads, deletes). Updates catalog tables (SYSTABLES, SYSINDEXES). Optimizer uses for access path selection. RUNSTATS TABLESPACE db.ts INDEX(ALL).
DB2 ⭐ Featured
👁 0

Q: How does REORG work?

Answer:
REORG physically reorganizes tablespace or index. Eliminates fragmentation, reclaims space, restores clustering. REORG TABLESPACE db.ts. Options: SHRLEVEL (REFERENCE/CHANGE), LOG (YES/NO). Schedule during low activity. Run RUNSTATS after.
CICS ⭐ Featured
👁 0

Q: What is CICS Liberty?

Answer:
CICS Liberty embeds Java server. Run Java apps in CICS. RESTful services. Modern application development. Coexists with COBOL. Container environment.
DB2 ⭐ Featured
👁 0

Q: How to handle -904 SQLCODE?

Answer:
-904 is resource unavailable. Tablespace/index in restricted state, stopped, or unavailable. Check display status. May need START DATABASE command. Check for REORG, RECOVER, LOAD running. Wait and retry.
DB2
👁 0

Q: How to use window functions?

Answer:
ROW_NUMBER() OVER (PARTITION BY col ORDER BY col2). RANK, DENSE_RANK for rankings. SUM/AVG/COUNT OVER for running totals. PARTITION BY groups within result. ORDER BY within partition. Powerful analytics.
DB2
👁 0

Q: What is CHECK utility?

Answer:
CHECK validates data integrity. CHECK DATA TABLESPACE db.ts. Finds constraint violations, orphan rows. CHECK INDEX validates index structure. CHECK LOB for LOB issues. Run periodically or after issues.
DB2
👁 0

Q: Explain partitioning strategies

Answer:
Range partitioning by value ranges (date, key ranges). Hash partitioning distributes evenly. Partition independence allows parallel operations. Partition pruning improves queries. Rotate partitions for time-series.
DB2
👁 0

Q: What is REBIND and when needed?

Answer:
REBIND updates access path without precompile. REBIND PACKAGE after RUNSTATS, index changes. REBIND PLAN for plan-level changes. Can improve or degrade performance - test first. EXPLAIN before/after.
COBOL
👁 0

Q: What is LINKAGE SECTION?

Answer:
LINKAGE SECTION defines parameters received from calling program. Items here have no memory until CALL provides addresses via USING clause. Address established at runtime. Used for both passed parameters and dynamically addressed data.
COBOL
👁 0

Q: What is GOBACK vs STOP RUN?

Answer:
STOP RUN terminates entire run unit (all programs). GOBACK returns to caller; if main program, acts like STOP RUN. Use GOBACK in subprograms to return control. STOP RUN from subprogram ends everything unexpectedly.
COBOL
👁 0

Q: What is ON SIZE ERROR?

Answer:
ON SIZE ERROR traps arithmetic overflow. COMPUTE X = A + B ON SIZE ERROR PERFORM error-handler END-COMPUTE. Also NOT ON SIZE ERROR for success. Must be enabled (TRUNC option). Prevents abends from overflow conditions.
COBOL
👁 0

Q: How does PERFORM THRU work?

Answer:
PERFORM para-1 THRU para-2 executes from para-1 through para-2 inclusive. Paragraphs must be contiguous. Common: PERFORM 1000-INIT THRU 1000-EXIT where EXIT paragraph has only EXIT. Ensures cleanup code always runs.
COBOL
👁 0

Q: What is CURSOR IS clause?

Answer:
In Screen Section, CURSOR IS field-name positions cursor. ACCEPT screen-name WITH CURSOR. Runtime positions to specified field. Can set dynamically. Used in interactive COBOL (CICS typically handles cursor differently).
VSAM
👁 0

Q: What causes file status 34?

Answer:
Status 34 is boundary violation or record too large. Record exceeds defined maximum. Check RECORDSIZE definition. May have wrong record format. Truncation not automatic.
VSAM
👁 0

Q: How to recover damaged VSAM?

Answer:
Run VERIFY first. Then REPRO if possible. May need forward/backward recovery from logs. EXAMINE checks for problems. May need DELETE and restore from backup.
JCL
👁 0

Q: What is TYPRUN parameter?

Answer:
TYPRUN options: SCAN (syntax check, no execution), HOLD (submit but hold), COPY (copy JCL to SYSOUT), JCLHOLD (hold with JCL). TYPRUN=SCAN validates JCL without running. Useful for testing complex JCL before production.
CICS
👁 0

Q: What is ASSIGN command?

Answer:
ASSIGN retrieves system values. EXEC CICS ASSIGN USERID(ws-user) FACILITY(ws-term). Other options: SYSID, ABCODE, PROGRAM. Gets runtime environment info. Useful for audit, conditional processing.
JCL
👁 0

Q: What is AMP parameter?

Answer:
AMP specifies VSAM buffer parameters. AMP='BUFNI=8,BUFND=4' for index/data buffers. AMP='AMORG' for VSAM organization. OPTCD for options. Overrides VSAM cluster definitions for this run. Affects performance.
JCL
👁 0

Q: How to use JCLTEST?

Answer:
TYPRUN=JCLTEST validates JCL without execution. Checks syntax, dataset names, authorization. Some systems support TYPRUN=SCAN which is similar. Submit job and check messages. No resources actually allocated.
CICS
👁 0

Q: How to use DOCTEMPLATE?

Answer:
DOCTEMPLATE defines dynamic content. Create template with symbols. Insert data at runtime. EXEC CICS DOCUMENT SET/INSERT. For generating responses.
CICS
👁 0

Q: What is CICS asynchronous processing?

Answer:
RUN TRANSID for async execution. EXEC CICS RUN TRANSID(xx) CHILD. FETCH CHILD waits for completion. Modern async pattern. Alternative to START.