Can anyone suggest a better way than that shown below to implement a Timed Wait in RPG?
C TIME TIMEA 60
C Z-ADDTIMEA TIMEB 60
C TIMEA DOWEQTIMEB
C TIME TIMEB
My concern with a delay as implemented above is that it is very processor intensive. Unless the job as a whole were assigned a very low priority it could all but freeze the system and were the delay to be larger than 1 second, say 1 minute, then the freeze could become a nuisance to other users.
In the particular assignment which needs this delay function, it cannot be achieved outside the RPG program, so a CL wait is of no use unless it is part of a separately threaded CLP which sends timed messages to the RPG program (in which case the question becomes one of how to wait for a message within an RPG program).