FN_SYSDAT - Gets the actual SYSTEM date
Inclusion in RPG source
- I /COPY E$LIB/SRC(ILE),DS_E$DATE
. . .
. . .
C /COPY E$LIB/SRC(ILE),FN_SYSDAT
Invocation
- EXSR SRSYSD
Input Parameters
- *N/A
Output Parameters
- SYSYMD (d8)
- Field to contain the system date as Year-Month-Day (YYYYMMDD).
- SYSDMY (d8)
- Field to contain the system date as Day-Month-Year (DDMMYYYY).
- SYSDD (d2)
- Field to contain the day number of the system date (DD).
- SYSMM (d2)
- Field to contain the month number of the system date (MM).
- SYSYY (d4)
- Field to contain the year of the system date (YYYY).
What it does
- The routine retrieves the system date and fills easy-to-use variables for quick and efficient programming.
- This routine must be called at the start of the program or, if the program keeps running over night, everytime when the system date is needed so the beginning of a new day will be detected by the program.
- If you want to have the work day date instead, use FN_DAYDAT. It uses the same invocation and output paramaters.
Examples
-
* --------------------------------------------------------------- Program initialization routine: * C SRINIT BEGSR * C *LIKE DEFN DBFLD SVFLD * C MOVEL*BLANK ZZA01 1 * C MOVELMSGFIL MSGFL P C CLEARMSGID C EXSR E$MSG * C EXSR SRSYSD * C ENDSR * * --------------------------------------------------------------- /COPY E$LIB/SRC,FN_E$MSG /COPY E$LIB/SRC,FN_SYSDAT * ---------------------------------------------------------------
Go to download page