Is there any way to make the cobol code just sleep for some time and then wake up after the specified time just like we have fgets in c.
I need to know this because I have to make the main cobol code thread to sleep for say 20 seconds and then wake up so that the initiated child thread finishes its work and gives the data back to main thread.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
The child thread is not locking it due to some reason.I have not got any errors as such.
Please clarify this.
What do you expect to be "locked"?
When an executing program calls "some code" the calling code automatically stops executing - there is no locking. When the called module returns control to the caller (goback) the caller proceeds from the instructon after the call.
If your called module isues a STOP RUN, your process will simply terminate and return to the caller will not happen.
I wonder why You want to write a RYO multitasking application in COBOL ??
the usual approach in multitasking
is to define an ECB and have the mother task wait on it
when the child/daughter process ends it should post the ECB
and the mother task will be waked from the wait...
no sleep function needed
just a good understanding of mvs/zos multitasking tecniques
but... for plain cobol when You call a function/subroutine the process is syncronous with the calling process
and the calling process will be continue when the called program returns