• Current date in RPGLE

    From Sharad Khare@sharadkhareji@gmail.com to comp.sys.ibm.as400.misc on Sun Jan 8 22:24:53 2023
    From Newsgroup: comp.sys.ibm.as400.misc

    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
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From John McCann@john_j_mccann@yahoo.co.uk to comp.sys.ibm.as400.misc on Mon Jan 9 02:12:02 2023
    From Newsgroup: comp.sys.ibm.as400.misc

    Hi Sharad

    Can you use %DATE instead of *DATE.

    DTODAY S D
    C EVAL TODAY = %DATE()

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Jon Paris@jonboy49@partner400.com to comp.sys.ibm.as400.misc on Mon Jan 9 14:41:22 2023
    From Newsgroup: comp.sys.ibm.as400.misc

    On Monday, January 9, 2023 at 1:24:55 AM UTC-5, sharad...@gmail.com 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.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Sharad Khare@sharadkhareji@gmail.com to comp.sys.ibm.as400.misc on Tue Jan 10 08:33:56 2023
    From Newsgroup: comp.sys.ibm.as400.misc

    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, sharad...@gmail.com 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!!
    --- Synchronet 3.21d-Linux NewsLink 1.2