For Programmers: Free Programming Magazines  


Home > Archive > Cobol > May 2007 > Microfocus Cobol "SLEEP" routine









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Microfocus Cobol "SLEEP" routine
C C

2007-05-15, 6:55 pm

Hello.

Is there a way in MF Cobol to pause program execution (sleep) for, let's
say, 5 minutes??? My workaround is to call the AIX command "sleep 300". I
need a routine in Cobol itself so I may vary the time to pause in some
programs.

Thanks in advance.


Steve Rainbird

2007-05-15, 6:55 pm

"C C" <someone@atsbcglobal.net> wrote in message
news:yAh2i.4627$UU.2661@newssvr19.news.prodigy.net...
> Hello.
>
> Is there a way in MF Cobol to pause program execution (sleep) for, let's
> say, 5 minutes??? My workaround is to call the AIX command "sleep 300".
> I need a routine in Cobol itself so I may vary the time to pause in some
> programs.
>
> Thanks in advance.
>



Not that I know of.

I use

call "system" using ws-sleep-call


Where ws-sleep-call is defined as

01 ws-mss-sleep-call.
03 pic x(6) value "sleep ".
03 ws-mss-sleep pic 9(15).999.
03 pic x value x"00".

Works for me.

--
Steve



Thomas

2007-05-15, 6:55 pm

On 15 Mai, 14:20, "C C" <some...@atsbcglobal.net> wrote:
> Hello.
>
> Is there a way in MF Cobol to pause program execution (sleep) for, let's
> say, 5 minutes??? My workaround is to call the AIX command "sleep 300". I
> need a routine in Cobol itself so I may vary the time to pause in some
> programs.
>
> Thanks in advance.


Hello,

I don't know a commando for sleep.

Either you write a loop with perform varying... or you use a loop with
checking out the time while it is looping.
But in both solutions the program/machine is (very) busy and not
sleeping!

Thomas

C C

2007-05-15, 6:55 pm

Thanks. That's what I'm doing right now. I just want to avoid having to
call "system". In AIX, a new-line is output by the system thus online
sessions experience a shift on their screen. This behavior still occurs
even if my call "system" script re-directs output to /dev/null.


"Steve Rainbird" <news.nospam@rainbird.me.nospam.uk> wrote in message
news:5atoomF2qeibjU1@mid.individual.net...
> "C C" <someone@atsbcglobal.net> wrote in message
> news:yAh2i.4627$UU.2661@newssvr19.news.prodigy.net...
>
>
> Not that I know of.
>
> I use
>
> call "system" using ws-sleep-call
>
>
> Where ws-sleep-call is defined as
>
> 01 ws-mss-sleep-call.
> 03 pic x(6) value "sleep ".
> 03 ws-mss-sleep pic 9(15).999.
> 03 pic x value x"00".
>
> Works for me.
>
> --
> Steve
>
>
>



Vaclav Snajdr

2007-05-15, 6:55 pm

it is possible to use "accept with timeout xyz" instead call system ...
(in background programs too)



C C wrote:
[color=darkred]
> Thanks. That's what I'm doing right now. I just want to avoid having to
> call "system". In AIX, a new-line is output by the system thus online
> sessions experience a shift on their screen. This behavior still occurs
> even if my call "system" script re-directs output to /dev/null.
>
>
> "Steve Rainbird" <news.nospam@rainbird.me.nospam.uk> wrote in message
> news:5atoomF2qeibjU1@mid.individual.net...

--
Vaclav Snajdr
Steve Rainbird

2007-05-15, 6:55 pm

"C C" <someone@atsbcglobal.net> wrote in message
news:Pzi2i.3295$zj3.230@newssvr23.news.prodigy.net...
> Thanks. That's what I'm doing right now. I just want to avoid having to
> call "system". In AIX, a new-line is output by the system thus online
> sessions experience a shift on their screen. This behavior still occurs
> even if my call "system" script re-directs output to /dev/null.
>
>
> "Steve Rainbird" <news.nospam@rainbird.me.nospam.uk> wrote in message
> news:5atoomF2qeibjU1@mid.individual.net...
>
>



Have you tried call "SYSTEM" there is a difference but I can't remember
offhand what it is.

Or maybe even CBL_EXEC_RUN_UNIT although I have never used this.

--
Steve



C C

2007-05-15, 6:55 pm

I think "TIME-OUT" needs a SCREEN SECTION. I don't want SCREEN SECTION in
the sleep functionality I am trying to implement in programs under cron or
batch control.

"Vaclav Snajdr" <snajdr.vaclav@t-online.de> wrote in message
news:f2cdof$tbi$01$1@news.t-online.com...
> it is possible to use "accept with timeout xyz" instead call system ...
> (in background programs too)
>
>
>
> C C wrote:
>
>
> --
> Vaclav Snajdr



Sergey Kashyrin

2007-05-15, 6:55 pm

Why just not to call it directly ?

CALL 'sleep' USING BY VALUE 300.

Regards,
Sergey


"C C" <someone@atsbcglobal.net> wrote in message
news:yAh2i.4627$UU.2661@newssvr19.news.prodigy.net...
> Hello.
>
> Is there a way in MF Cobol to pause program execution (sleep) for, let's
> say, 5 minutes??? My workaround is to call the AIX command "sleep 300".
> I need a routine in Cobol itself so I may vary the time to pause in some
> programs.
>
> Thanks in advance.
>



William M. Klein

2007-05-15, 6:55 pm

I don't know which versions it is and is not in, but check your documentation
for the Micro Focus callable service

CBL_THREAD_SLEEP

P.S. I haven't actually used it myself, so "YMMV"

--
Bill Klein
wmklein <at> ix.netcom.com
"C C" <someone@atsbcglobal.net> wrote in message
news:yAh2i.4627$UU.2661@newssvr19.news.prodigy.net...
> Hello.
>
> Is there a way in MF Cobol to pause program execution (sleep) for, let's say,
> 5 minutes??? My workaround is to call the AIX command "sleep 300". I need a
> routine in Cobol itself so I may vary the time to pause in some programs.
>
> Thanks in advance.
>



James J. Gavan

2007-05-15, 6:55 pm

William M. Klein wrote:
> I don't know which versions it is and is not in, but check your documentation
> for the Micro Focus callable service
>
> CBL_THREAD_SLEEP
>
> P.S. I haven't actually used it myself, so "YMMV"
>

Out of curiosity I went looking, searching on 'WAIT', 'SLEEP' - no luck.
Never thought of CBL_THREAD......

Here's the reference to it in Net Express V 5.0 :-

http://supportline.microfocus.com/s...50/nx50indx.htm

Jimmy
Vaclav Snajdr

2007-05-16, 7:55 am

no, accept with timeout need not the screen section.
The program using this is a background program and can be
run via cron too. In this case you need set the TERM to console
perhaps (so i had it under hp-ux) - because accept needs the ADIS.

C C wrote:
[color=darkred]
> I think "TIME-OUT" needs a SCREEN SECTION. I don't want SCREEN SECTION in
> the sleep functionality I am trying to implement in programs under cron or
> batch control.
>
> "Vaclav Snajdr" <snajdr.vaclav@t-online.de> wrote in message
> news:f2cdof$tbi$01$1@news.t-online.com...

--
Vaclav Snajdr
C C

2007-05-16, 7:55 am

I had tried this but the compiler returns an error if there is no screen
section! I don't know what directive I should use to compile the TIME-OUT
without a screen section.

Anyway, I have successfully tested the "CALL "sleep" USING BY VALUE 300.".
AND it does not return a newline to the running program thus NOT shifting
the screen one line up.

"Vaclav Snajdr" <snajdr.vaclav@t-online.de> wrote in message
news:f2ejmp$bs2$01$1@news.t-online.com...
> no, accept with timeout need not the screen section.
> The program using this is a background program and can be
> run via cron too. In this case you need set the TERM to console
> perhaps (so i had it under hp-ux) - because accept needs the ADIS.
>
> C C wrote:
>
>
> --
> Vaclav Snajdr



Gael Wilson

2007-05-17, 7:55 am


"William M. Klein" <wmklein@nospam.netcom.com> wrote in message
news:KVn2i.438596$c62.361592@fe07.news.easynews.com...
>I don't know which versions it is and is not in, but check your
>documentation for the Micro Focus callable service
>
> CBL_THREAD_SLEEP
>
> P.S. I haven't actually used it myself, so "YMMV"
>


Note that your application has to be threaded in order to use this API
otherwise it returns immediately with a non-zero RETURN-CODE, as the
CBL_THREAD_ APIs are only available in the threaded COBOL run-time.

Gael.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com