Supported RPG Features

Date literals use the D'yyyy-mm-dd' form, e.g. DCL-S due DATE INZ(D'2026-05-01');.

Dates may be compared directly with relational operators (=, <>, <, >, <=, >=), and a day duration may be added to or subtracted from a date:

due = invoiceDate + %DAYS(30);   // 30 days after the invoice date
overdue = today > due;           // date comparison yields an indicator

Durations may be chained in a single expression, and the result stays a date (or time/timestamp): endOfTerm = start + %MONTHS(1) - %DAYS(1);. A chained date expression, and the %DATE() / %TIME() / %TIMESTAMP() results, are date-valued anywhere a date is expected - stored into a date field, passed to %CHAR, or displayed with DSPLY.