Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How do I make a cobol code sleep

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How do I make a cobol code sleep
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

Site Director


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

PostPosted: Wed Jun 04, 2008 5:49 am    Post subject:
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    Post subject: Reply to: How do I make a cobol code sleep
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

Site Director


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

PostPosted: Wed Jun 04, 2008 5:56 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Wed Jun 04, 2008 11:49 am    Post subject: Reply to: How do I make a cobol code sleep
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 4 Wed Mar 29, 2017 12:47 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts CA Workload Automation event code help vinu78 CA Products 10 Wed Mar 01, 2017 10:05 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us