What date is returned after midnight rollover on AS/400 job queue?

235 pts.
Tags:
AS/400 Job Queue
CL Program
RTVJOBA
V5R4
We have nightly jobs that are queued up to release at 23:59 each night. Depending on how many are released at once, it may or may not make it into the jobq before midnight. The main CL program calls a second CL program after midnight. The called CL program uses the RTVJOBA command to get date. What date is returned? The date before or after midnight?

Software/Hardware used:
IBM iSeries AS400 Version V5R4

Answer Wiki

Thanks. We'll let you know when a new response is added.

Here is the HELP text for RTVJOBA
<pre> CL var for DATETIME (20) (DATETIME) – Help

Specifies the name of a CL variable that receives the current local date
and time of the job. The variable must be a character variable with a
minimum length of 20 characters. The local job date and time is
returned in the format YYYYMMDDHHNNSSXXXXXX where YYYY is the year, MM
is the month, DD is the day, HH is the hours, NN is the minutes, SS is
the seconds, and XXXXXX is the microseconds.

That looks like it either the started or current time for a job.
If you want to get the time it entered the system, you would need to do a DSPJOB output(*PRINT) then interagate the spool file. The entered data/time is available there.</pre>

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Canuhp
    Don't need to get the time it entered the system, just need to know which it will return. If returns the date prior to midnight that is good. If it returns the date after midnight then I need to move it back a day. At month end this becomes a critical question.
    235 pointsBadges:
    report
  • TomLiotta
    IIRC, the DATE() and CYMDDATE() parameters will return the job date, while DATETIME() returns current date. That is, the date from either of the first two parameters can be different from the date from the third parameter. Job date is set at the moment that the job starts; it doesn't change while the job runs even past midnight. Current date changes at midnight. If your job starts to run at 10:30 PM on Oct 19, 2010, and continues running for five hours, the job date will still be 10/19/2010 while the job is ending. But the current date will have changed to 10/20/2010. RTVJOBA DATE(&date) will return the date from before midnight if the job started before midnight. If the job simply was stuck on a job queue until after midnight and then it started, it will get the date after midnight. Tom
    125,585 pointsBadges:
    report
  • Canuhp
    Thanks so much for the help!!
    235 pointsBadges:
    report
  • TomLiotta
    Just to test results, I submitted a trivial CL program that did DLYJOB until 1:15 AM, retrieved all three dates, and ran DMPCLPGM.
    &CYMDDATE                *CHAR            7       '1101019'             
    &DATE                    *CHAR            6       '101910'              
    &DATETIME                *CHAR           20       '20101020011500007984'
    The first two values show the "job date" of Oct 19, 2010. The timestamp shows "current" date/time with Oct 20, 2010, for the date. So, you get a choice. Tom
    125,585 pointsBadges:
    report
  • Canuhp
    Great Tom, thanks!
    235 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following