Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 855
  • Last Modified:

Changing the JOB DATE of an AS/400 batch job

Hi All,

I have a batch process that takes in a number of input files - some of these have start/end dates for the records.

This all works fine until you want to restore back to a known state and re-run the process using a few day's worth of input data.  If the start date on the records has already passed - then bam! Those records are rejected.

In the JOBD that the job runs against, I see there's a JOB DATE field.  What I'm thinking is to change this from *SYSVAL to the value of the date that the job would normally have been run on.

This sounds exceedingly simple, but I think it just may work.

Can anyone please give their thoughts on:

 - whether all programs run within the job will take on the JOB DATE and not the system date?
 - whether there are any impacts on changing the job date?
 - if the JOBD is the best place (or even the only place??) to be making this change?

fyi - I'm not an RPG programmer, nor do I have access to the source code.

Regards,

Matt
0
mattratt
Asked:
mattratt
1 Solution
 
daveslaterCommented:
Hi
it is all dependant on how the program was written.

if they are using %date or Time to get the date then this is the system dat & time and not the job,

If they use *date or Udate then these reference the job date so it may well work.

either way give it a test - if they are reports then it will not do any harm.


dave
0
 
tliottaCommented:
Yep, Dave's essentially right. If programs request "job date", then they'll get the value of the job date attribute. If programs request "system date", then they'll get the QDATE system value.

(Technically with the some systems, it _might_ be possible to get a third date based on the 'software clock'. I haven't tested this, but it seems reasonable.)

The point is that without knowing how a program is written, it's difficult to make definite predictions on results.

Tom
0
 
dedy_djajapermanaCommented:
- whether all programs run within the job will take on the JOB DATE and not the system date?
A program takes date value from where it takes it from, it may take system date, or it may take from JOB date. like Dave and Tom said, depends on how the program is written.

 - whether there are any impacts on changing the job date?
Depends, you should understand if you understand the answer for question#1

 - if the JOBD is the best place (or even the only place??) to be making this change?
The other place is to change the system value itself, CHGSYSVAL QDATE . But, not many people do this considering the impact is to entire system, and there may be impact that's not anticipated. You should understand very well what impact would it be to the other jobs in the system if you change it.


dd
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now