How to put a program to sleep

The environment is Visual COBOL 2017 and the objective is to put a program into sleep mode for one minute. Looking in the COBOL manual there is a System Routine of CBL GC NANOSLEEP that will do the job but the call to this routine fails (not found). Searching my C drive does not find the routine. So my questions are;

1. Is this routine the way to go or are there other alternatives? 

2.  If this is the alternative, how do I acquire this System Routine?

Parents
  • Verified Answer

    I believe that you are looking in the manual for the GnuCOBOL product and not for Micro Focus Visual COBOL.

    There is a routine in Visual COBOL called CBL_THREAD_SLEEP that can be used.

    It is documented here:

    Example:

     

           01 any-key  pic x.
           01 sleep-time  pic x(4) comp-5 value 60000.
           procedure division.
               display "this is a test of sleep for one minute"
               call "CBL_THREAD_SLEEP" using sleep-time
               display "after sleep"
               accept any-key
               goback.
    
Reply
  • Verified Answer

    I believe that you are looking in the manual for the GnuCOBOL product and not for Micro Focus Visual COBOL.

    There is a routine in Visual COBOL called CBL_THREAD_SLEEP that can be used.

    It is documented here:

    Example:

     

           01 any-key  pic x.
           01 sleep-time  pic x(4) comp-5 value 60000.
           procedure division.
               display "this is a test of sleep for one minute"
               call "CBL_THREAD_SLEEP" using sleep-time
               display "after sleep"
               accept any-key
               goback.
    
Children
No Data