Hi,
In program 'Z1' , at the end , you can schedule another background job for scheduling second program where you can pass the jobnumber and jobcount, scheduled n hours later.
After n hours, 2nd program will check the status of current job . If completed, come out of the report. If still executing delete the current job. Normally FM related to background job starts with 'BP*'.
Regards,
DPM