Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Asleep at the Wheel 1

Status
Not open for further replies.
M

Member 310024

Guest
... with apologies to Bob Wills & his Texas Playboys.
Is there a way of making a PC COBOL (Microsoft,which I believe is re-badged Microfocus COBOL V4.5)program go to sleep for a while?
I have a program which I use to load records from a sequential file into an ISAM file.
I would like to issue an ACCEPT statement after every
100,000 records, to allow me to say Y (keep going) or N (stop). But ... if I haven't responded after say 1 minute,
I would like the program to continue.
I also want to avoid the PERFORM UNTIL using ACCEPT TIME to
decide when 1 minute is up.
 
If really MF Cobol you may try something like this:
ACCEPT ... WITH TIMEOUT AFTER 60

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I'm not sure COBOL would really have the capability to do what you're asking. Especially within that ACCEPT clause to get a character.

I'll have to think a little more, perhaps, on how to approach it. But if PHV's answer ends up working, great!
 
That particular version may not have that functionality, but recent (not that recent) versions of ACUCCOBOL, RM/COBOL and MicroFocus COBOL are all able to do that.

Format similar to what PHV mentioned.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Thankyou PHV ... You're Brilliant!
It took a bit of experimentation to get it going,but eventually it worked.

There seems to be some positional dependancy.
Have a look at this :-

Code:
000066*                                                                
000067 01  WF-STOP                         PIC X(01).                  
000068 01  WW-TIMEOUT                      PIC 9(04) COMP VALUE 10.    
000069*                                                                
                                                                       
000189*                                                                
000190     IF WW-RECORDS-READ-Z00102(7:) = ZERO                        
000191         ACCEPT WF-STOP AT 1441 FROM CRT TIMEOUT AFTER WW-TIMEOUT
000192     END-IF.                                                     
                                                                       
COBOL software by Micro Focus                                          
Copyright (C) Microsoft Corporation 1984,1991.  All rights reserved.   
Copyright (C) Micro Focus Ltd. 1984,1991.  All rights reserved.        
                                                                       
* Checking complete with no errors - starting code generation          
* NCG Error At Int Code Address - 0003E3                               
* R013 *                                                               
**    Illegal intermediate code.

But when I changed it to :-

Code:
000189*                                                                 
000190     IF WW-RECORDS-READ-Z00102(7:) = ZERO                         
000191         PERFORM 2100-CONTINUE-OR-NOT                             
000192     END-IF.                                                      
000193*                                                                 
                                                                        
  1108*                                                                 
  1109*=================================================================
  1110*                                                                 
  1111 2100-CONTINUE-OR-NOT SECTION.                                    
  1112*                                                                 
  1113 CONTROL-PARAGRAPH.                                               
  1114*                                                                 
  1115     ACCEPT WF-STOP AT 1441 FROM CRT TIMEOUT AFTER WW-TIMEOUT.    
  1116     MOVE WF-STOP TO WF-EOF-Z00102.                               
  1117*                                                                 
  1118 EXIT-PARAGRAPH.                                                  
  1119     EXIT.

It worked.
Greatly appreciated.
 
There are 2 solution in ACUCOBOL:

1. call "C$SLEPP" using 100
2. accept field before time 100

The time is allways 1/100 second.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top