× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I must admit, I learned (from experiences similar to yours) a long time ago never, ever to use the job date. In almost all cases where you say "this'll never run past midnight", eventually something will come up where it will. It's just not worth it.

In CL, I would either use RTVSYSVAL QDATE -- in which case, I'm always very careful not to make any assumptions about what the date format will be. (That's another thing I've been bit with far too many times.. people assume that QDATE will be in MMDDYY order, and then it gets run on a system with DDMMYY or YYMMDD and the program goes haywire...) Easiest way to make sure the date format is consistent is to use CVTDAT FROMFMT(*SYSVAL), to convert my QDATE field to a known format.

Or, better yet, in newer programs I use the ILE CEE date/time APIs.

in RPG, of course, I use the %date() BIF which makes it really easy.


On 7/19/2013 3:58 PM, dale janus wrote:
I often use RTVJOBA in CL to get user name and system date. I know it's
the job date, but since nothing around here ever runs past midnight, I
figured I was ok.

WRONG!

I have some month end inventory processing that I run on the last day of
the month. It manipulates the dates so I can get the month, the month
from 2 years ago and from 3 years ago and date stuff we've all done lots
of times.

I had a home grown CL where I would put in 1 years worth of dates and
run if it was the 25.

So I got 'smart' and set it up as a scheduled job last December. It has
been running like clockwork at 10pm the 25th of each month (our month
end). What I did not realize was the job is set as the day I put in on
the schedule, not the day it runs. So for the last 6 months, I was
re-running December 25th 2012 over and over. (I'm not even sure how it
got 12/25/12 as the date submitted. No one around here works on
christmas) I use the month number as part of the file name, so my
FILENAME12 stuff got overlayed every month.

I have now changed those jobs to RTVSYSVAL QDATE.

I'm sure I read somewhere, sometime,a long time ago, that scheduled jobs
use the job date when added to the schedule, not the date run. But I
forgot about it.

Now I've got to see what I can clean up and how far back our backups
go. I just wanted to share my sad tale as I go off to cry in my beer.
Lots of beer.

---Dale


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.