IBM Mainframe Discussion List <[email protected]> wrote on 04/30/2013 12:33:19 PM:
> From: Anthony Rudd <[email protected]> > I am sorry that I was too imprecise. > I need a programmed solution, prefererably called from REXX (IRXJCL). > The situation: > I have submitted as batch job (possibly long running). > In a separate batch job, I need to wait until the first job has completed. Assuming you want to answer the question on the same lpar the job is running, see code fragment below edited from complex program. I have seen this done in Cobol, bless their hearts. I assume it can be done in any HLL. J COMMON1 RETRYN DS 0H STIMER WAIT,DINTVL=$TIME_D COMMON1 DS 0H L R9,CVTPTR -->CVT USING CVTMAP,R9 L R8,CVTASVT -->ASVT (+22C) USING ASVT,R8 LA R7,ASVTENTY -->ASCB vector table (+210) SR R4,R4 = count of hits SR R10,R10 LOOP DS 0H * LA R10,1(R10) ICM R6,15,0(R7) -->ASCB JM UNUSED USING ASCB,R6 CLC ASCBASCB,=C'ASCB' JNE BADASCB L R5,ASCBASSB -->ASSB USING ASSB,R5 *here check value in ASSBJBNS and take action if JNE NEXT *the job is still running *if you are wanting to wait J RETRYN UNUSED DS 0H N R6,=X'7FFFFFFF' JNZ UNUSED1 J NEXT UNUSED1 DS 0H NEXT DS 0H LA R7,4(R7) C R10,ASVTMAXU JL LOOP DROP R5,R6,R8,R9 *the job is not running . . . CVT LIST=YES,DSECT=YES IHAASVT LIST=YES IHAASCB LIST=YES IHAASSB LIST=YES END ----------------------------------------- The information contained in this communication (including any attachments hereto) is confidential and is intended solely for the personal and confidential use of the individual or entity to whom it is addressed. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this communication in error and that any review, dissemination, copying, or unauthorized use of this information, or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. Thank you ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
