I believe purging of records would be done in loop.
You could save the Start time of the Job during initialization subroutine and store to Work Variable.
And, At the end of the loop you could retrieve current system date and compare against the start time. If the Difference is 2 hrs, You could consider exiting Loop and Proceed with Exit Routine.
If you are purging the records in SQL with single DELETE statement, I would suggest to have the DELETE query with particular set of records once, and then delete the next set of records. Consider Comparing Time Difference between each set.
Eg: DELETE FROM FILE WHERE RRN BETWEEN 1 AND 10000,
Compare the Date, If difference isnt 2 hrs, Repeat the loop to delete next set.
If You’re not willing to do this way, You should have CL Driver to submit a Job, And Track the submitted Job Details.
for Sample code to Retrieve Job Details
Have DELAY Command for 2 Hours. And, End the Job after Two hours.