Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Mainframe COBOL, How Can I Send a Message to the Console Operator, Wait for a Response, Then Continue?

I have a very long running COBOL program that runs randomly at various times during the day. The Console operator wants to be notified when it starts up and have the program wait so they can go get coffee before letting the job go ahead. How can I do this with COBOL?

like image 421
dstaudacher Avatar asked Mar 17 '17 00:03

dstaudacher


1 Answers

Use the COBOL 'STOP' statement, like this:

 IDENTIFICATION DIVISION.               
 PROGRAM-ID. SAMPLE.                    
 PROCEDURE DIVISION.                    
     STOP 'GO GET COFFEE' 
* program waits until operator responds                 
     DISPLAY 'PROGRAM WILL NOW CONTINUE'
* program now continues 
*    [...]      
     GOBACK.                             
like image 84
dstaudacher Avatar answered Nov 10 '22 15:11

dstaudacher