DB2 ⭐ Featured
👁 0

Q: What is CTE (Common Table Expression)?

Answer:
CTE defines temporary result set. WITH cte_name AS (SELECT...) SELECT * FROM cte_name. Improves readability. Can be recursive for hierarchies. Multiple CTEs comma-separated. Referenced in main query. Scope is single statement.
VSAM ⭐ Featured
👁 0

Q: Explain REUSE parameter

Answer:
REUSE allows reloading without delete/define. DEFINE CLUSTER ... REUSE. OPEN OUTPUT resets to empty. Like scratch and rewrite. Good for temporary work files. Cannot be UNIQUE.
JCL ⭐ Featured
👁 0

Q: How to pass data between steps?

Answer:
Use DISP=PASS to pass datasets. Receiving step references same DSN. Or use symbolic parameters. GDG allows relative references (+1 created, 0 passed). Temporary datasets (&& prefix) auto-pass. SYSIN instream data copied to subsequent steps.
CICS ⭐ Featured
👁 0

Q: How to use temporary storage?

Answer:
TS queue stores data across tasks. EXEC CICS WRITEQ TS QUEUE(name) FROM(data). READQ retrieves. DELETEQ removes. ITEM number for multiple items. MAIN/AUXILIARY for storage type. Named by string.
VSAM
👁 0

Q: How to create temporary VSAM?

Answer:
Use REUSE attribute. Or define/delete in same job. Or use GDG-like naming. JCL doesn't support && for VSAM. IDCAMS DELETE at job end. Cannot be truly temporary like sequential.
JCL
👁 0

Q: How to define temporary dataset?

Answer:
Temporary datasets: DSN=&&TEMP or omit DSN. Exist for job duration only. Not cataloged. Passed between steps with DISP=PASS. Automatically deleted at job end. Example: //WORK DD DSN=&&TEMP,UNIT=SYSDA,SPACE=(CYL,5)
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.