There have been lots of answers, and I'll give a couple, some are variations on previous posts.
I'm not a fan of guessing that a 5 second delay solves the issue, but then I use it sometimes...
Variation 2 is simplest with no pgm changes
If original job = CALL ABC
If submitting = CALL XYZ
Var 1. if XYZ is a clp just add DLYJOB DLY(5) as 1st step
If XYZ not a clp, or you cannot modify XYZ then create CLLE XYZ1 with same parms as XYZ
PGM
DLYJOB DLY(5)
CALL XYZ
ENDPGM
Var 2. since you said this is thru AJS (I think someone said that)
Make XYZ it's own job and perhaps a different jobq, and make dependent upon ABC finishing. If you have parms this could be an issue that could be resolved with various places to store (data queue, data area, file, ) but that is pgm changes
Var 3. I do this something like this (if needed). Allocate *EXCL a dtaara in 1st pgm for 2nd pgm to check.
Program ABC
RTVOBJD OBJ(*LIBL/ABC) OBJTYPE(*PGM) RTNLIB(&RTNLIB)
CHKOBJ OBJ(&RTNLIB/ABC) OBJTYPE(*DTAARA)
MONMSG MSGID(CPF9800) EXEC(CRTDTAARA +
DTAARA(&RTNLIB/ABC) TYPE(*CHAR) LEN(1) +
TEXT('alcobj if in use'))
ALCOBJ OBJ((&RTNLIB/ABC *DTAARA *EXCL))
/* whatever ABC does */
SBMJOB CMD(CALL PGM(XYZ)) JOB(XYZ)
ENDPGM
Program XYZ (or XYZ1)
$ALC: ALCOBJ OBJ((&RTNLIB/ABC *DTAARA *EXCL))
MONMSG MSGID(CPF1000) EXEC(DO)
DLYJOB DLY(2)
GOTO $ALC:
ENDDO
DLYJOB DLY(2) / just because dataarea not locked not mean all are freed */
/* whatever XYZ does */
Jim Franz
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Steinmetz, Paul
Sent: Wednesday, November 12, 2014 3:37 PM
To: 'Midrange Systems Technical Discussion'
Subject: SMBJOB - with delay
I’ve run into multiple case where I’m doing a SBMJOB, with either a cmd or pgm.
But, for this process to be successful (job I’m submitting from needs to end to rid record locks), I need to have a 5 second delay.
SBMJOB does not have a built in delay option.
Any thoughts from the group?
Thank You
_____
Paul Steinmetz
IBM i Systems Administrator
Pencor Services, Inc.
462 Delaware Ave
Palmerton Pa 18071
610-826-9117 work
610-826-9188 fax
610-349-0913 cell
610-377-6012 home
psteinmetz@xxxxxxxxxx<mailto:psteinmetz@xxxxxxxxxx>
http://www.pencor.com/
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.