DB2 ⭐ Featured
👁 0

Q: How to use UNION?

Answer:
UNION combines SELECT results. UNION removes duplicates, UNION ALL keeps all. Column count and types must match. ORDER BY at end only. UNION expensive due to sort. Use UNION ALL if duplicates OK or impossible.
COBOL
👁 0

Q: What is SORT and MERGE in COBOL?

Answer:
SORT orders records: SORT SORT-FILE ON ASCENDING KEY-FIELD USING INPUT-FILE GIVING OUTPUT-FILE. INPUT/OUTPUT PROCEDURE allows processing during sort. MERGE combines pre-sorted files: MERGE SORT-FILE ON KEY USING FILE-1 FILE-2 GIVING OUTPUT-FILE.
JCL
👁 0

Q: How does MERGE work?

Answer:
DFSORT MERGE combines pre-sorted files. SORTIN01, SORTIN02, etc. inputs. MERGE FIELDS=(1,10,CH,A). Files must be sorted on merge key. Output one sorted file. Preserves input order for equal keys.
CICS
👁 0

Q: What is CONVERSE?

Answer:
CONVERSE combines SEND and RECEIVE. EXEC CICS CONVERSE FROM(out) INTO(in). One command for both. Simpler for simple screens. Less control than separate commands.
DB2
👁 0

Q: What is MERGE statement?

Answer:
MERGE updates or inserts conditionally. MERGE INTO target USING source ON condition WHEN MATCHED THEN UPDATE WHEN NOT MATCHED THEN INSERT. Combines INSERT/UPDATE logic. Efficient for sync operations.