👁 0
Q: How to code symbolic override?
Answer:
EXEC proc,SYM1=value1,SYM2=value2. Symbols defined in PROC with SET or & default. Override replaces default. Multiple overrides comma-separated. Must match PROC symbols. Case sensitive.
👁 0
Q: How to write recursive CTE?
Answer:
WITH RECURSIVE cte AS (base-case UNION ALL recursive-case referencing cte) SELECT * FROM cte. For hierarchies: start with root, join to find children. DEPTH limit prevents infinite recursion.
👁 0
Q: What is EVALUATE statement and when to use it?
Answer:
EVALUATE is COBOL's case/switch construct. Syntax: EVALUATE TRUE WHEN condition-1 statement WHEN OTHER default END-EVALUATE. More readable than nested IF for multiple conditions. Can evaluate multiple subjects and use THRU for ranges.
👁 0
Q: How to use intrinsic functions?
Answer:
COBOL-85 intrinsic functions: FUNCTION LENGTH(field), FUNCTION CURRENT-DATE, FUNCTION UPPER-CASE(field), FUNCTION NUMVAL(field), FUNCTION MOD(a,b), FUNCTION INTEGER-OF-DATE(date). Use in expressions or with COMPUTE. Return values only, no side effects.
👁 0
Q: How to handle status 96?
Answer:
Status 96 is no DD statement for file. Check JCL has correct DD name. May be dynamic allocation failure. DD name must match SELECT ASSIGN. Case sensitive in some systems.
👁 0
Q: What causes IEF452I error?
Answer:
IEF452I is symbolic substitution error. Symbol not defined or wrong format. Check SET statements, PROC defaults. Verify symbol names match. May be missing &. Case matters for some systems.
👁 0
Q: What is CASE expression?
Answer:
CASE provides if-then logic. CASE WHEN cond1 THEN val1 WHEN cond2 THEN val2 ELSE default END. Simple CASE: CASE col WHEN 'A' THEN 'Active' END. Use in SELECT, WHERE, ORDER BY. Powerful for transformations.
👁 0
Q: Explain ORDER BY options
Answer:
ORDER BY sorts results. ORDER BY col1 ASC, col2 DESC. ASC default. NULLS FIRST/LAST controls NULL position. Ordinal: ORDER BY 1, 2 uses column positions. ORDER BY CASE for custom order. Affects performance.