For example, checking status of a submitted job. It doesn't make sense to check the status of the job every second or micro second.
Normally the jobs take minutes or hours or at least some seconds. If we have such a scenario, we have to run a job and wait until the job is complete. We shall introduce the wait function before checking the job status.
As usual, REXX is such a easy and simple language. The implementation is so simple.
/*REXX*/
SECS = 20
TIMEDIFF = 0
STARTTIME = TIME('S')
SAY 'I am going to wait for 20 seconds'
DO UNTIL TIMEDIFF >= SECS
TIMEDIFF = TIME('S') - STARTTIME
END
SAY 'I am done with waiting for 20 seconds'
EXIT
Incase of questions or any feedback, please write your questions in the comments.
No comments:
Post a Comment