COBOL ⭐ Featured
👁 0

Q: How to use FUNCTION CURRENT-DATE?

Answer:
FUNCTION CURRENT-DATE returns 21-char timestamp. Format: YYYYMMDDHHMMSSDHHMM (D=hundredths, HH=GMT offset). MOVE FUNCTION CURRENT-DATE TO WS-TIMESTAMP. Parse components with reference modification or REDEFINES.
DB2 ⭐ Featured
👁 0

Q: What is CURRENT DATE function?

Answer:
CURRENT DATE returns today's date. CURRENT TIME for time. CURRENT TIMESTAMP for both. No parentheses needed. Used in SELECT, WHERE, INSERT. Can compare: WHERE hire_date > CURRENT DATE - 30 DAYS.
DB2 ⭐ Featured
👁 0

Q: How to handle date arithmetic?

Answer:
DATE + n DAYS adds days. DATE - n MONTHS subtracts months. DAYS(date2) - DAYS(date1) gives day count. DATEDIFF function available. TIMESTAMPDIFF for time differences. DATE/TIME functions for extraction.
CICS
👁 0

Q: Explain ASKTIME ABSTIME

Answer:
ABSTIME is packed decimal timestamp. Microseconds since 1/1/1900. ASKTIME returns current. FORMATTIME converts to readable. Use for calculations, comparisons. Full precision timing.
DB2
👁 0

Q: How to handle -818 SQLCODE?

Answer:
-818 is timestamp mismatch between plan and DBRM. DBRM precompiled after last BIND. Solutions: REBIND plan/package, ensure DBRM library current, check promotion procedures. Timestamp in DBRM must match bound plan.