MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TSO SUB

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
deepeshk79
Beginner


Joined: 20 Jun 2003
Posts: 112
Topics: 48
Location: Bangalore

PostPosted: Mon Oct 06, 2003 1:53 am    Post subject: TSO SUB Reply with quote

Hi all,

I tried the following code
Code:

ADDRESS TSO "SUB 'PDSONE.JCLS(JCLONE)' "       
SAY RC                                         
IF RC = 0 THEN                                 
   ADDRESS TSO "SUB 'PDSONE.JCLS(JCLTWO)' " 
EXIT 0 


The rexx routine executes both these jcls irrespective of the return code of JCLONE, but i need to execute JCLTWO only if JCLONE is successful(RC=0)

Any thoughts???

Thanks,
Deepesh
Back to top
View user's profile Send private message AIM Address
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Mon Oct 06, 2003 2:04 am    Post subject: Reply with quote

Deepesh,
I guess you had got it wrong. "RC" gives the return code based on whether the previous submit statement had executed sucessfully or not. It does not know/need not bother to know the return code of the job, that was in turn submitted. If you would need to find the return code of the job that was submitted, you can do either of the following :
1. Use Wait logic in your program(*not warranted*)
2. Chase control blocks.(Do a search for it)

Hope this helps...

Cheers,
Coolman.
________
EXTREME Q VAPORIZER


Last edited by coolman on Sat Mar 12, 2011 8:32 pm; edited 1 time in total
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Oct 06, 2003 5:30 am    Post subject: Reply with quote

deepeshk79,


A simple way to solve the problem is to append a step to your JCLONE job which will submit the JOB 2

ex:

Code:

//LASTSTEP EXEC PGM=IKJEFT01,
//             PARM='SUBMIT PDSONE.JCLS(JCLTWO)'
//SYSTSPRT DD SYSOUT=*


or
Code:

//LASTSTEP EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1    DD DSN=PDSONE.JCLS(JCLTWO),DISP=SHR
//SYSUT2    DD SYSOUT=(*,INTRDR)


If you still insist on checking on the RC in rexx itself you can go with the options suggested by coolman.

The following topic covers the extraction of return code using rexx

http://www.mvsforums.com/helpboards/viewtopic.php?t=44

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
deepeshk79
Beginner


Joined: 20 Jun 2003
Posts: 112
Topics: 48
Location: Bangalore

PostPosted: Mon Oct 06, 2003 6:41 am    Post subject: Reply with quote

Hi Kolusu and Coolman,

Thanks for your help. I will prefer to have Internal Reader than Rexx.

Deepesh
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group