MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Waiting in (PL1) program for any batch job

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Tue Jul 10, 2007 4:18 am    Post subject: Waiting in (PL1) program for any batch job Reply with quote

Hi,

i have (pl1) program (mvs batch, started by jcl). This program submitts an other batch job using internal reader.

Is it possible to wait in the first program, until the by internal reader submitted batch job has finised ?

Any comments ?

bauer
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Jul 10, 2007 4:36 am    Post subject: Reply with quote

1. each batch job writes a record (repro) corresponding to an appropriate 'this job is finished' to a VSAM file; the executing PL1 pgm does CALLs to an HLASM pgm that uses the WAIT macro (unless you can execute an assembler macro directly from PL1). Use of proper shr options on the VSAM allows the batch job to write and the PL1 to read.

I suggest VSAM, because QSAM will have exclusives that can not be overriden at run-time.


2. PL1 calls a REXX interface to SDSF to determine JOB status. Maybe PL1 can interface directly with SDSF; I know nothing about PL1.

That's my contribution.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue Jul 10, 2007 12:37 pm    Post subject: Reply with quote

PL/1 has a WAIT statement which allows multitasking/threading within the program. You could possibly utilise that. But it would be better, I would have thought, to teminate the first program once it has submitted the job and put the rest of the code into another program to be either executed by the second job or in a third job submitted by the second job. I would prefer, though, if this was a production job, to have the scheduler do all job submissions.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Tue Jul 10, 2007 5:56 pm    Post subject: Reply with quote

agreed... waiting for batch jobs is generally (but not always) poor design. There is no guarantee that or when the job will run, abends can't be dealt with, the original job must wait and holds resources as it does. But if this is the only way to do what you need, I'd follow Nic's & Dick's advice to use WAIT and check for the existence of the other job every few seconds or so. You can check by checking for a data set or other resource that the job creates, by using SDSF or by looking at some control blocks (CVT->ASVT entries>ASCBs) PL/I would be a good language for that since it handles pointers nicely and I think (you should check though) that all the required control blocks are 'intended programming interfaces' so they will not change.
Back to top
View user's profile Send private message Visit poster's website
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Thu Jul 12, 2007 6:23 am    Post subject: Reply with quote

Thank you for your comments !
Back to top
View user's profile Send private message
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Fri Jul 13, 2007 1:25 am    Post subject: Reply with quote

If it was me I would use sockets. The first job can submit the second and then listen for a completion message. Sockets are easy and if you use blocking I/O it does all the suspend stuff for you. We use sockets a lot in our products, cross-memory, SRBs have been thrown out of the window because with HyperSockets you can shuttle data around at memory speed.

I do agree with Nic though, if you've got a scheduler you should use it.
_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Fri Jul 13, 2007 7:53 am    Post subject: Reply with quote

Dave, can you give me a pointer to any info on this? I have an immediate need for this that just came up last night so any info would help, especially assembler interfaces or canned system routines to help.
Back to top
View user's profile Send private message Visit poster's website
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Fri Jul 13, 2007 9:25 am    Post subject: Reply with quote

semigeezer wrote:
Dave, can you give me a pointer to any info on this? I have an immediate need for this that just came up last night so any info would help, especially assembler interfaces or canned system routines to help.


No worries. If you want me to give specific help on a solution then please feel free to contact me offline.

There are several socket interfaces in HLASM, REXX, C and a callable service that can be called from any language. Check out http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/F1A1BK80
for the programming guides which contain heaps of info and samples.
_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group