IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Connect Direct return code


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
martinho

New User


Joined: 16 Oct 2006
Posts: 3

PostPosted: Mon Oct 16, 2006 5:15 pm
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2359
Location: Israel

PostPosted: Mon Oct 16, 2006 5:59 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Mon Oct 16, 2006 6:08 pm
Reply with quote

You probably want to specify MAXDELAY=UNLIMITED when you submit your process.
Back to top
View user's profile Send private message
martinho

New User


Joined: 16 Oct 2006
Posts: 3

PostPosted: Mon Oct 16, 2006 6:34 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Mon Oct 16, 2006 7:10 pm
Reply with quote

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
View user's profile Send private message
martinho

New User


Joined: 16 Oct 2006
Posts: 3

PostPosted: Mon Oct 16, 2006 7:53 pm
Reply with quote

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
View user's profile Send private message
LeonDirect

New User


Joined: 13 Jan 2022
Posts: 5
Location: South Africa

PostPosted: Thu Jan 13, 2022 6:27 pm
Reply with quote

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
View user's profile Send private message
LeonDirect

New User


Joined: 13 Jan 2022
Posts: 5
Location: South Africa

PostPosted: Thu Jan 13, 2022 6:34 pm
Reply with quote

Back to top
View user's profile Send private message
LeonDirect

New User


Joined: 13 Jan 2022
Posts: 5
Location: South Africa

PostPosted: Thu Jan 13, 2022 6:39 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts DL/I status code AK for GU call using... IMS DB/DC 1
No new posts IEF142I and Cond. Code 12 All Other Mainframe Topics 3
No new posts IBM CODE PAGES IBM Tools 0
No new posts REXX GETMSG does not return £HASP880... CLIST & REXX 2
No new posts Cond parameter and Rc code of a proce... JCL & VSAM 5
Search our Forums:

Back to Top