On Tue, 14 Jan 2014 16:12:31 -0500, Jim Mulder wrote:

>  There have been a few  discussions over the years on IBM-MAIN as to
>how to SLEEP for some period of time in REXX.  I was asked today to look
>at a dump of a "hung testcase" , and came across the following example
>of how *not* to do it:
>
>/* REXX */
>/* WAIT 10 SECONDS FOR THE MESSAGE TO COMPLETE  */
>NEW_TIME = 0
>OLD_TIME = TIME('S')
>DO WHILE (OLD_TIME + 10 > NEW_TIME)
> NEW_TIME = TIME('S')
>END
>RETURN(0)
>
>  This was in a testcase that we have been using since 1988.
>So amusingly, when this EXEC got invoked within 10 seconds
>before midnight:
>
May I heartily recommend:

    address SYSCALL 'sleep 10'

(Might not have worked in 1988.  But trying to rescue the above
nowadays by folding in the date, etc. is an exercise in stubbornness.)

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to