Scheduling job automatically with dynamic date range

 3 Replies
 0 Subscribed to this topic
 17 Subscribed to this forum
Sort:
Author
Messages
Vijay S
Veteran Member Send Private Message
Posts: 174
Veteran Member

Is there a way to schedule a job automatically in "recdef" and passing job parameters automaticcaly like To & From date range. They have to be from the past 7 days . Like for today's run , From-date=today, to-date=today-7 days....... 

 

 

Thanks,

 

Vijay

jaherb
Veteran Member Send Private Message
Posts: 164
Veteran Member
recdef has no way of updating job submission parameters, but there are a couple of other options. In the case you described, I would opt for additional code in the program to get the current system run date, use that as the "TO DATE" and then calculate the "FR DATE" using the 900-INCREMENT-DATE API. This job could then be scheduled on the frequency you desired and would take care of the date logic. The second way would be to write a new program where you can actually modify the date parameters. You would need to make use of the 900-LOAD-JOB to manipulate the parameters. You could also have this new program on the schedule and after manipulating the dates, do a 900-SUBMIT-JOB. You would probably find the first way the easiest.
mikeP
Veteran Member Send Private Message
Posts: 151
Veteran Member
Another option is to use a scheduled process flow to modify the jobdef parameters, and optionally, submit the job rather than scheduling through recdef. I prefer to have similar things all accessible in the same place e.g. scheduled jobs, but we work with the tools we have.
Vijay S
Veteran Member Send Private Message
Posts: 174
Veteran Member
Thanks Mike & Jim for your help ! .....