IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How do I make a cobol code sleep


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prashant_mq

New User


Joined: 29 Aug 2006
Posts: 24

PostPosted: Wed Jun 04, 2008 5:23 am
Reply with quote

Hi,

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.

Thanks in advance.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 04, 2008 5:49 am
Reply with quote

Hello,

COBOL does not have a "sleep" statement.

If you "call" what you refer to the "child thread", the calling module will "wait" until the called code completes.

Why will this not work for you?
Back to top
View user's profile Send private message
prashant_mq

New User


Joined: 29 Aug 2006
Posts: 24

PostPosted: Wed Jun 04, 2008 5:51 am
Reply with quote

The child thread is not locking it due to some reason.I have not got any errors as such.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 04, 2008 5:56 am
Reply with quote

Hello,

Quote:
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.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jun 04, 2008 11:49 am
Reply with quote

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
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts run rexx code with jcl CLIST & REXX 15
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Compile rexx code with jcl CLIST & REXX 6
Search our Forums:

Back to Top