View previous topic :: View next topic
|
Author |
Message |
martinho
New User
Joined: 16 Oct 2006 Posts: 3
|
|
|
|
In my jcl, I have 2 jobsteps ; A CD copy step, followed by a non-CD step. I only want the 2nd step to run if the CD copy is successful, i.e. it has run to completion, not just successfully been 'submitted'. Is this possible ?
Thanks |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
You will have to put some in-between step (like REXX) that reads the "real" return code of NDM and exit with the appropriate RC. NDM in batch will always return the result of the submit command.
O. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
You probably want to specify MAXDELAY=UNLIMITED when you submit your process. |
|
Back to top |
|
|
martinho
New User
Joined: 16 Oct 2006 Posts: 3
|
|
|
|
Thanks for the previous two replies.
Not a REXX expert - would it be complex ?
What would be the effect of MAXDELAY=UNLIMITED ? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Quote: |
You can synchronize Processes by coding the MAXDELAY keyword parameter on either the SUBMIT statement or on the PROCESS statement. The MAXDELAY keyword enables you to suspend the execution of the DMBATCH jobstep until the submitted Process either completes or a specified interval of time elapses. |
The following example shows the MAXDELAY keyword coded on the SUBMIT statement:
Code: |
//SYSIN DD *
SIGNON USERID=(USER01,PASSWRD)
SUBMIT PROC=PROCAAA MAXDELAY=UNLIMITED
SIGNOFF
/*
|
You can also place the MAXDELAY keyword on the PROCESS statement for PROCAAA:
Code: |
PROCAAA PROC SNODE=REMOTE.NODE.B MAXDELAY=UNLIMITED
STEP01 COPY TO (DSN=to_dsn -
SNODE) -
FROM (DSN=from_dsn -
PNODE)
|
Quote: |
If you code MAXDELAY in a Process and submit it through the IUI, your TSO session hangs until the Process completes.
|
|
|
Back to top |
|
|
martinho
New User
Joined: 16 Oct 2006 Posts: 3
|
|
|
|
Many thanks Superk. So, just to confirm, if I use the MAXDELAY=UNLIMITED parm (assume it doesn't matter which statement I set it on, PROCESS or SUB), any jobsteps after the sub PROC command won't execeute until the CD process successfully completes? The jobstep is IEBGENER in my example....where CDPROC contains the COPY stmts. I'd try this out myself but I've just been informed we need a new part for our test C D environment and it won't be here until tomorrow !
Code: |
//NDM EXEC CDPROC,PROCL=TEST.PROCESS.LIB,COND=(0,NE)
//SYSIN DD *
SIGNON CASE=YES
SUBMIT PROC=CD1 MAXDELAY=UNLIMITED
SIGNOFF
/*
//IEBGENER EXEC PGM=IEBGENER,COND=(0,NE)
//SYSIN DD *
//SYSUT1 DD DUMMY
//SYSUT2 DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
|
|
|
Back to top |
|
|
LeonDirect
New User
Joined: 13 Jan 2022 Posts: 5 Location: South Africa
|
|
|
|
16 years late, but here goes:
I wouldn't use MAXDELAY=UNLIMITED, as that would literally make your job wait forever (or until something else times out somewhere).
Rather use a reasonable time for your situation like:
MAXDELAY = 00:02:30 (2 and a half minutes).
Now you'll get either a zero=transfer complete OR 48=time expired before it was finished/even started - you can assume it failed.
Using MAXDELAY alters the behaviour of the step quite significantly (in terms of the COND CODES you'll get back), and you need to understand that in order to code your JCL's response behaviour properly.
I set up a nice little document about that, am going to try and paste it in here |
|
Back to top |
|
|
LeonDirect
New User
Joined: 13 Jan 2022 Posts: 5 Location: South Africa
|
|
Back to top |
|
|
LeonDirect
New User
Joined: 13 Jan 2022 Posts: 5 Location: South Africa
|
|
|
|
LeonDirect wrote: |
OK I'm new here, and the forum seems a little irky. My document contains a table that outlines what MAXDELAY does. I don't see how I can paste that in here and make it show correctly, so I am going to try and attach the Word document. |
OK that was harder than it needed to be! Turns out .DOCX files not allowed, but no error message either. Anyway, let's hope it goes up now in PDF format |
|
Back to top |
|
|
|