Marc's Place

 

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
© 1997- Marc Vos (and others)   -   Privacy Statement   -    Contact Me

On this website, Google Analytics is used to track visitor statistics. These are anonymised data about the number of visitors, which pages they visit on this site, from which regions they visit, which web browsers they use, etc.. You will also see non-personalised ads via Google AdSense. Cookies from Paddle or Paypal are placed when you click on a 'Buy now!' or 'Donate!' button, and possible cookies from Disqus when you use that system to comment on one or more blogposts.
Privacy Statement