View previous topic :: View next topic |
Author |
Message |
bauer Intermediate
Joined: 10 Oct 2003 Posts: 315 Topics: 49 Location: Germany
|
Posted: Tue Jul 10, 2007 4:18 am Post subject: Waiting in (PL1) program for any batch job |
|
|
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 |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Tue Jul 10, 2007 4:36 am Post subject: |
|
|
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 |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue Jul 10, 2007 12:37 pm Post subject: |
|
|
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 |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Tue Jul 10, 2007 5:56 pm Post subject: |
|
|
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 |
|
|
bauer Intermediate
Joined: 10 Oct 2003 Posts: 315 Topics: 49 Location: Germany
|
Posted: Thu Jul 12, 2007 6:23 am Post subject: |
|
|
Thank you for your comments ! |
|
Back to top |
|
|
DaveyC Moderator
Joined: 02 Dec 2002 Posts: 151 Topics: 3 Location: Perth, Western Australia
|
Posted: Fri Jul 13, 2007 1:25 am Post subject: |
|
|
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 |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Fri Jul 13, 2007 7:53 am Post subject: |
|
|
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 |
|
|
DaveyC Moderator
Joined: 02 Dec 2002 Posts: 151 Topics: 3 Location: Perth, Western Australia
|
Posted: Fri Jul 13, 2007 9:25 am Post subject: |
|
|
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 |
|
|
|
|