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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Question: How to 'break/pause/wait' a BATCH program?
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Tue Jun 03, 2008 9:20 pm    Post subject: Reply to: Question: How to 'break/pause/wait' a BATCH progra
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

Moderator Team Head


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

PostPosted: Tue Jun 03, 2008 9:30 pm    Post subject: Reply to: Question: How to 'break/pause/wait' a BATCH progra
Reply with quote

Here's a few previous topics on this subject:

http://www.ibmmainframes.com/viewtopic.php?t=9708
http://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    Post subject: Reply to: Question: How to 'break/pause/wait' a BATCH progra
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    Post subject:
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

Site Director


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

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

Site Director


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

PostPosted: Wed Jun 04, 2008 2:06 am    Post subject: Reply to: Question: How to 'break/pause/wait' a BATCH progra
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 04, 2008 11:55 am    Post subject:
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    Post subject: Reply to: Question: How to 'break/pause/wait' a BATCH progra
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

Site Director


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

PostPosted: Wed Jun 04, 2008 7:28 pm    Post subject:
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    Post subject: Re: Question: How to 'break/pause/wait' a BATCH program?
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:
http://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    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 Batch job tuning sgandhla Testing & Performance analysis 0 Fri Mar 24, 2017 9:41 pm
No new posts MIPS/CPU consumption reduction in Batch vishwakotin DFSORT/ICETOOL 4 Sat Mar 18, 2017 5:46 pm
No new posts Asynchronous CICS Processing Question moezbud CICS 0 Mon Mar 06, 2017 6:13 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 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