SYSDATE is one of the first system variables beginners encounter because nearly every production report needs a run date in the header. Broadcom Easytrieve Report Generator defines SYSDATE automatically—you never DECLARE or DEFINE it in the Library section. At the moment Easytrieve execution starts, the product loads SYSDATE with the current system date from the mainframe clock. That value stays read-only for the life of the run unless your installation uses special test overrides. Payroll registers show SYSDATE so operators know which calendar day produced the listing. Audit extracts stamp processing date without hard-coding literals that go stale every midnight. TITLE lines place SYSDATE at column sixty in countless shop standards. Understanding SYSDATE means understanding how Easytrieve separates display dates from numeric date fields, how the Options Table DATE and DATESEP settings shape what you see, and when to prefer SYSDATE-LONG for century-safe archives. This page covers syntax, format options, assignment into working storage, report TITLE patterns, comparison with business as-of dates from files, migration from legacy macro %GETDATE, and mistakes that cause wrong IF tests or truncated headers.
System-defined fields are maintained internally by Easytrieve. SYSDATE belongs to the general-purpose family documented alongside SYSTIME and RETURN-CODE. You reference SYSDATE by name in assignment statements, IF conditions where type rules allow, DISPLAY diagnostics, and REPORT TITLE or LINE lists. The field is read-only: assignment to SYSDATE itself is not the supported pattern. Instead, move SYSDATE into a working storage field when you need to edit, strip separators, or compare against file dates stored in numeric form.
| Aspect | Behavior |
|---|---|
| When set | System date at start of Easytrieve execution |
| Writable | Read-only system field |
| DEFINE required | No—reserved system name |
| Typical format | MM/DD/YY with slash separators (DATE option) |
| Century variant | SYSDATE-LONG for MM/DD/YYYY style |
The DATE option in the Easytrieve Options Table determines how dates appear in the compiler listing and how SYSDATE and SYSDATE-LONG are stored for your installation. DATESEP sets the separator character—often a slash. European shops may configure day-before-month ordering. Never assume your test LPAR matches production without checking both listings. A TITLE line that fits eight characters on one system may truncate on another if DATE option uses a longer pattern. Run a one-line DISPLAY program after any Options Table change affecting DATE or DATESEP.
SYSDATE-LONG holds the same execution-start calendar date but includes the century in the external representation. Year-end archival jobs and compliance extracts increasingly require four-digit years to avoid ambiguity when rerunning historical comparisons. TITLE formatting options LONGDATE and SHORTDATE on some report statements map to these system fields—LONGDATE prints SYSDATE-LONG while SHORTDATE prints SYSDATE. Choose the variant that matches your retention policy and downstream file consumers.
Report titles are the most visible SYSDATE usage. Place the system field at a fixed column so multi-page listings align in SDSF. Combine literal text with SYSDATE rather than embedding dates in source that require recompile after calendar roll. NODATE on formatting options suppresses automatic date insertion when you want full manual control—useful when TITLE already positions SYSDATE explicitly.
123456REPORT PAYROLL-RPT TITLE 01 'PAYROLL REGISTER' TITLE 02 'RUN DATE:' COL 55 SYSDATE JOB INPUT PERSNL LINE EMP-NAME GROSS NET-PAY
TITLE 02 prints the literal RUN DATE label starting at column fifty-five followed by SYSDATE at the position the report writer calculates from COL. Adjust column to match your shop standard—sixty is common on one-thirty-two-column listings.
Copy SYSDATE once at job initialization when the same run date must appear on every page and output record. Define a working field wide enough for the formatted string—often eight to ten alphabetic bytes for slash forms, more for SYSDATE-LONG. Numeric date math on hire dates or period-end fields requires conversion: SYSDATE display form with slashes does not compare directly to a six-digit numeric N field storing YYMMDD. Use date macros such as %DATEVAL or documented date functions after copying and normalizing separators.
12345678910111213DEFINE RUN-DATE W 10 A DEFINE RUN-DATE-N W 6 N INIT-JOB. PROC RUN-DATE = SYSDATE * Convert for numeric compares—verify macro on your release %DATEVAL RUN-DATE-N RUN-DATE END-PROC JOB INPUT CONTROL-FILE START INIT-JOB IF PERIOD-END GT RUN-DATE-N DISPLAY 'WARNING: PERIOD END AFTER RUN DATE' END-IF
SYSDATE answers when did this job execute operationally. Payroll period-end date on a control record answers which pay cycle the numbers belong to. Monthly financial close may run on the fifth calendar day while the business as-of remains last day of prior month. Display both on audit headers: period end from file, run date from SYSDATE. Schedulers sometimes pass as-of dates through JCL PARM or SYSIN—prefer those parameters for business logic when they override calendar run date. SYSDATE remains valuable for operational traceability even when business date comes from elsewhere.
SYSDATE is fixed at execution start. Long-running batch that crosses midnight does not refresh SYSDATE automatically. A job starting at eleven fifty-five PM and finishing at twelve ten AM still shows the start date in SYSDATE. Capture RUN-DATE in initialization if downstream steps need a single consistent stamp for the entire job. For row-level timestamps requiring current clock during processing, see SYSTIME patterns or explicit time functions—not SYSDATE alone.
Development programs DISPLAY SYSDATE alongside file counts to correlate test output with calendar day. Production FINISH procedures sometimes DISPLAY run date when RETURN-CODE is non-zero so operations logs show context without opening JCL. Keep DISPLAY volume reasonable on large production runs—one banner at START or FINISH suffices for date context.
SYSDATE is a sticker the computer puts on your report showing today's date when the program starts. You do not make the sticker yourself—it is already there. You can copy the sticker onto your own paper if you need to cut off the slashes or compare the date to numbers in a file. The sticker does not change if the clock strikes midnight while your program is still running; it keeps the date from when you started.
1. SYSDATE in Easytrieve contains:
2. SYSDATE is normally formatted with:
3. SYSDATE-LONG differs from SYSDATE because it:
4. You should assign SYSDATE to a working field once when:
5. Attempting to DEFINE a field named SYSDATE: