System functions read the world around the program—not the payroll file. Current date for report title as of processing day. Time of day when batch started for SYSPRINT banner. Job name and step name proving which JCL execution produced output. User ID of submitter for audit regulations requiring who ran this job. Without system functions, programmers hard-code dates in source—wrong every midnight boundary—or pass values through SYSIN parameters manually maintained. System builtins automate context headers operations expect on every production report. Easytrieve Plus documents $DATE, $TIME, and related environment functions in system index; spelling and return format vary by release and OPTIONS. Beginners assign system date into packed field meant for display string—or into A 8 when formatted output needs A 10—causing truncation or wrong comparisons. This index explains date and time retrieval, job and user metadata, assignment once versus per record, formatting system values for TITLE, timezone and clock considerations on LPAR, and audit patterns compliance teams request on financial batch output.
Current date function returns processing date—usually system date at job start unless date simulation PARM or special facility overrides for testing. Time function returns time of day for timestamp lines. Return may be packed numeric CCYYMMDD, character MM/DD/YYYY after format step, or binary seconds since epoch per manual—never assume without reading DEFINE compatibility. Assign RUN-DATE once in initialization PROC before JOB INPUT loop; TITLE references RUN-DATE on every page without re-invoking function. Payroll date-of-run versus pay-period-end date are different business concepts—do not substitute system date for period end stored in control file.
123456* Illustrative—verify names and formats on your system RUN-DATE = $DATE RUN-TIME = $TIME RUN-DATE-EDIT = EDIT(RUN-DATE, 'MM/DD/YYYY') TITLE 'PAYROLL REGISTER ' RUN-DATE-EDIT
Job name function returns JCL JOB card name—helps when same program runs under multiple job names in test and prod. Step name identifies which step within job—useful when proc contains multiple Easytrieve steps writing different reports. DISPLAY job and step on SYSPRINT at startup accelerates ops search in SDSF when user reports wrong output. Length of returned name must fit DEFINE A field—eight-character classic job names versus longer special characters on some systems.
User ID function returns submitter or execution user per security product integration. Audit reports stamp CREATED-BY on output records for SOX trails. Do not log passwords or sensitive tokens—only documented user identifiers. RACF or Top Secret identity may differ from TSO userid displayed—document which identity function returns for your shop.
| Family | Typical return | Common use |
|---|---|---|
| Date | Current processing date | Report headers, run stamps |
| Time | Time of day | SYSPRINT banners, elapsed calc start |
| Job name | JCL job identifier | Diagnostic and audit context |
| Step name | Exec step name | Multi-step proc disambiguation |
| User ID | Submitter or runner | Compliance audit trails |
Raw system date into packed field may work for IF comparisons. Human TITLE needs EDIT or date format function second step. Chain: SYS-DATE = $DATE; SYS-DATE-CHAR = EDIT or format function. Mismatch when IF SYS-DATE-CHAR GT LITERAL compares strings not chronology—compare packed dates for date logic, edited strings for display only.
Test regions simulate dates via control cards or PARM options so regression runs do not depend on calendar day. Document override in test JCL README. Production must use real system date unless business backdating explicitly authorized. Clock changes at midnight and DST transitions affect time function—schedule long jobs crossing midnight knowing RUN-DATE captured at start may differ from date at end.
Control file may carry processing date chosen by scheduler—system date function ignores that business date. When scheduler passes date in SYSIN, prefer parameter over $DATE for business as-of. System date suits when did this job run operationally. Both may appear on same report: period end from file, run date from system function.
Call once per job for invariant values. Per-record system time stamp on million-row output file adds CPU and widens record layout—use when audit mandates row-level timestamp; otherwise job-level header suffices.
System functions ask the computer clock and name tag questions. What day is it today? What time is it? What is this job called? Who pressed start? The answers go on the cover of your homework so the teacher knows when and who turned it in—not inside each math problem unless every line needs its own timestamp.
1. System functions return values from:
2. $DATE or DATE function typically supplies:
3. Assigning system date once before JOB loop:
4. User ID function supports:
5. System function return must fit: