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

Question: How to 'break/pause/wait' a BATCH program?


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

New User


Joined: 03 Jun 2008
Posts: 2
Location: Brazil

PostPosted: Tue Jun 03, 2008 9:13 pm
Reply with quote

I'm trying to stop a BATCH program for a few secs (1 or maybe 2) but I didn't find any commands/syntax that can help me.

So, are there any commands that can stop the process or delay it?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jun 03, 2008 9:20 pm
Reply with quote

what is the business reason to artificially delay a program that has already started execution ?

please do not answer THAT' S THE REQUIREMENT icon_cool.gif
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Jun 03, 2008 9:30 pm
Reply with quote

Here's a few previous topics on this subject:

www.ibmmainframes.com/viewtopic.php?t=9708
www.ibmmainframes.com/viewtopic.php?t=13553
Back to top
View user's profile Send private message
Thiago

New User


Joined: 03 Jun 2008
Posts: 2
Location: Brazil

PostPosted: Tue Jun 03, 2008 10:28 pm
Reply with quote

No. I want to stop the program when he's already running. Not 'outside' in the JCL.

Here's an example. But this one is in CICS

Code:

MOVE  3                     TO  WS-TIME
                                       
EXEC CICS                               
     DELAY                             
     INTERVAL (WS-TIME)               
     RESP     (WS-STATUS)               
END-EXEC         


I need something like that, but for a batch program.
Thanks for the help.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jun 03, 2008 10:38 pm
Reply with quote

COBOL doesn't have a WAIT command so you would have to write an assemble program and call it from your COBOL program.

Quote:
what is the business reason to artificially delay a program that has already started execution ?

please do not answer THAT' S THE REQUIREMENT.
icon_confused.gif icon_confused.gif
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 1:18 am
Reply with quote

Hello,

What is going on that the "batch program" needs to wait for?

What should happen when the "thing" being waited for never happens (and that will happen).

As was asked before and not yet answered - what business requirement will be supported by this?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Jun 04, 2008 1:25 am
Reply with quote

dick scherrer wrote:
Hello,

What is going on that the "batch program" needs to wait for?

What should happen when the "thing" being waited for never happens (and that will happen).

As was asked before and not yet answered - what business requirement will be supported by this?


Should we wait for a reply?
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 2:06 am
Reply with quote

Unfortunately, i'm paused just now. . .

When resumed, i'll determine if i need to wait. . .

Maybe i just need a break icon_wink.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

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

Sigh ............. maybe the OP exited during subroutine and never regained control.
Back to top
View user's profile Send private message
Varun Singh

New User


Joined: 01 Aug 2007
Posts: 25
Location: Delhi

PostPosted: Wed Jun 04, 2008 12:09 pm
Reply with quote

For pausing a Batch program you can use.

Code:
STOP 'Press Enter to continue'.


The above code will pause your program and will require operator intervention.

But, whenever such condition arises I will suggest you to use Accept and Display verb

Do not use STOP literal statement in programs compiled with THREAD option.
icon_biggrin.gif
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 7:28 pm
Reply with quote

Hello,

Please do not use STOP or DISPLAY/ACCEPT unless you want the Operations people coming after you to do damage to you. It is not acceptable to do this on today's systems.

Most systems will not permit such code to be promoted to production, so there is no use wasting time testing it. Some systgems abend the job.
Back to top
View user's profile Send private message
Antonio Barata
Warnings : 1

New User


Joined: 04 Apr 2007
Posts: 37
Location: Lisbon, Portugal

PostPosted: Thu Jun 05, 2008 4:27 am
Reply with quote

Thiago wrote:
I'm trying to stop a BATCH program for a few secs (1 or maybe 2) but I didn't find any commands/syntax that can help me.

So, are there any commands that can stop the process or delay it?


Hi
I think that the following MVS Service will do what you want

(BPX1SLP, BPX4SLP) -- Suspend execution of a process for an interval of time

See this link:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/BPXZB161/2.208?SHELF=BPXZSH61&DT=20060111171933
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 Using API Gateway from CICS program CICS 0
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Help in Automating Batch JCL jobs mon... JCL & VSAM 3
No new posts DB2 Event passed to the Application P... DB2 1
Search our Forums:

Back to Top