Marc's Place

 

FN_DAYDAT - Returns WORK DAY date

Inclusion in RPG source

I /COPY E$LIB/SRC(ILE),DS_E$DATE
. . .
. . .
C /COPY E$LIB/SRC(ILE),FN_DAYDAT

Invocation

EXSR SRSYSD

Input Parameters

DAYDATE (*DTAARA)
Data area which contains the date (YYYYMMDD) to be used through the day by certain jobs until, for example, a day-closure starts during the night. The data area must be set to the new day date at the end of the day-closure.

Output Parameters

SYSYMD (d8)
Field to contain the work day date as Year-Month-Day (YYYYMMDD).
 
SYSDMY (d8)
Field to contain the work day date as Day-Month-Year (DDMMYYYY).
 
SYSDD (d2)
Field to contain the day number of the work day date (DD).
 
SYSMM (d2)
Field to contain the month number of the work day date (MM).
 
SYSYY (d4)
Field to contain the year of the work day date (YYYY).

What it does

The routine is used in programs that run after midnight but should still use the date of the day before. In some companies, working days start at 6:00 and end the next day at 3:00; so a work day spans over two calendar days.
 
This routine must be called at the start of the program.
 
If you want to have the system date instead, use FN_SYSDAT. 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_DAYDAT
 * ---------------------------------------------------------------
 
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