• Current date in RPGLE

    From Sharad Khare@21:1/5 to All on Sun Jan 8 22:24:53 2023
    Hi All,

    I'm trying to get current date using *date in RPGLE but when program called via job it takes job date some time jobs is not restarted same day it shows old date not the current date.

    Can you please suggest how to get current date from Job and integrative program run

    Thanks!
    Sharad

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John McCann@21:1/5 to All on Mon Jan 9 02:12:02 2023
    Hi Sharad

    Can you use %DATE instead of *DATE.

    DTODAY S D
    C EVAL TODAY = %DATE()

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jon Paris@21:1/5 to [email protected] on Mon Jan 9 14:41:22 2023
    On Monday, January 9, 2023 at 1:24:55 AM UTC-5, [email protected] wrote:
    Hi All,

    I'm trying to get current date using *date in RPGLE but when program called via job it takes job date some time jobs is not restarted same day it shows old date not the current date.

    Can you please suggest how to get current date from Job and integrative program run

    Thanks!
    Sharad
    You are probably using *DATE which is the wrong choice if you want to be certain of getting the current date. *DATE retrieves the _JOB_ date (i.e. the date the job entered the system). What you probably need is to use the BIF %Date() which will
    retrieve the current date.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sharad Khare@21:1/5 to Jon Paris on Tue Jan 10 08:33:56 2023
    On Tuesday, 10 January 2023 at 04:11:24 UTC+5:30, Jon Paris wrote:
    On Monday, January 9, 2023 at 1:24:55 AM UTC-5, [email protected] wrote:
    Hi All,

    I'm trying to get current date using *date in RPGLE but when program called via job it takes job date some time jobs is not restarted same day it shows old date not the current date.

    Can you please suggest how to get current date from Job and integrative program run

    Thanks!
    Sharad
    You are probably using *DATE which is the wrong choice if you want to be certain of getting the current date. *DATE retrieves the _JOB_ date (i.e. the date the job entered the system). What you probably need is to use the BIF %Date() which will
    retrieve the current date.
    Thank You!!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)