DB2 ⭐ Featured
👁 0

Q: What is OPTIMIZE FOR n ROWS?

Answer:
OPTIMIZE FOR n ROWS hints expected rows. SELECT * FROM t ORDER BY c OPTIMIZE FOR 1 ROW. Influences access path. Low n favors index. High n may favor scan. Use when you know actual row count.
VSAM ⭐ Featured
👁 0

Q: Explain MASSINSERT?

Answer:
MASSINSERT optimizes bulk sequential inserts. System defers CI splits. Better performance for loads. Implicit with REPRO. COBOL can hint with APPLY WRITE-ONLY style.
JCL ⭐ Featured
👁 0

Q: Explain DCB parameter

Answer:
DCB defines Data Control Block: RECFM (F/FB/V/VB/U), LRECL (record length), BLKSIZE (block size). DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920). Can inherit from existing dataset. LRECL required for new datasets. BLKSIZE=0 lets system optimize.
CICS ⭐ Featured
👁 0

Q: What is WRITE command?

Answer:
WRITE adds new record. EXEC CICS WRITE FILE(name) FROM(data) RIDFLD(key) LENGTH(len). DUPREC condition if key exists. KEYLENGTH for generic. MASSINSERT optimizes bulk loads.
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
👁 0

Q: What is FETCH FIRST?

Answer:
FETCH FIRST n ROWS ONLY limits result set. SELECT * FROM t ORDER BY col FETCH FIRST 10 ROWS ONLY. Optimizes query - doesn't retrieve all. OFFSET for paging. WITH TIES includes equal values.
DB2
👁 0

Q: What is VOLATILE table?

Answer:
VOLATILE TABLE hints optimizer to expect different row counts. Useful for varying cardinality. CREATE TABLE ... VOLATILE CARDINALITY. Or ALTER TABLE ... VOLATILE. Helps when statistics mislead optimizer.
DB2
👁 0

Q: Explain access path selection

Answer:
Optimizer chooses access path based on statistics, predicates, indexes. Index scan vs tablespace scan. Join methods: nested loop, merge scan, hybrid. Sort operations. EXPLAIN reveals choice. Tuning influences path.
DB2
👁 0

Q: What is profile table?

Answer:
Profile tables store user-specific optimizer settings. DSN_PROFILE_TABLE, DSN_PROFILE_ATTRIBUTES. Override defaults for specific statements. Use QUERYNO correlation. Advanced tuning technique.
COBOL
👁 0

Q: What is APPLY WRITE-ONLY?

Answer:
APPLY WRITE-ONLY FOR file-name optimizes output buffer handling. System doesn't preserve record area after WRITE. Can't re-read just-written record. Improves I/O performance. Use when write-only access pattern is guaranteed.
JCL
👁 0

Q: What causes S322 abend?

Answer:
S322 is job/step time exceeded. Check TIME parameter on JOB/EXEC. Causes: infinite loop, too much data, insufficient time allocated. Fix: increase TIME, optimize program, check data volumes. TIME=1440 is no limit (24 hours).
DB2
👁 0

Q: Explain DECLARE CURSOR syntax

Answer:
DECLARE cursor-name CURSOR FOR SELECT... WITH HOLD keeps open after COMMIT. WITH RETURN returns to caller. FOR UPDATE OF allows positioned update. FOR READ ONLY optimizes read. ORDER BY for sorting. Static or dynamic declaration.