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

JES2 job Return code


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ykishore

New User


Joined: 12 Aug 2005
Posts: 53
Location: USA

PostPosted: Fri Aug 12, 2005 6:10 pm
Reply with quote

Hi

Say Step1 and Step2 are there in a job in a sequence. We can validate Step1 return code with COND parameter in Step2.

Now Say I have JOB1 and JOB2;

I am submitting JOB2 from JOB1 with INTRDR.

I would like catch the return code of job1 in job2.

I can control the flow in JOB1 it self but, is there a way to get the return code of JOB1 in JOB2?
Back to top
View user's profile Send private message
shivashunmugam Muthu

Active User


Joined: 22 Jul 2005
Posts: 114
Location: Chennai

PostPosted: Fri Aug 12, 2005 6:28 pm
Reply with quote

hey..

when u r submitting a JOB thru INTRDR, job1 gets completed only when JOB2 finishes..

Experts

Correct me if am wrong!
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Fri Aug 12, 2005 11:59 pm
Reply with quote

This worked for me:
JOB1
Code:

//JOB1     JOB (...),CLASS=T,MSGCLASS=X           
//*                                               
//STEP0001 EXEC PGM=IDCAMS                       
//SYSPRINT DD   SYSOUT=*                         
//SYSIN    DD   *                                 
 SET MAXCC=8                                     
/*                                               
//*                                               
//STEP0002 EXEC PGM=ICEGENER                     
//SYSUT1   DD   DISP=SHR,DSN=&SYSUID..JCL(JOB2)   
//SYSUT2   DD   SYSOUT=(*,INTRDR)                 
//SYSPRINT DD   SYSOUT=*                         
//SYSIN    DD   DUMMY                             
//*                                               


JOB2
Code:

//JOB2     JOB (...),CLASS=T,MSGCLASS=X               
//*                                                   
//STEP0001 EXEC PGM=IDCAMS                             
//SYSPRINT DD   SYSOUT=*                               
//SYSIN    DD   *                                     
 SET MAXCC=0                                           
/*                                                     
//*                                                   
//STEP0002 EXEC PGM=IKJEFT01,PARM='%CHKRC JOB1'       
//SYSPROC  DD   DISP=SHR,DSN=&SYSUID..REXX             
//SYSTSPRT DD   SYSOUT=*                               
//SYSTSIN  DD   DUMMY                                 
//*                                                   


REXX Exec CHKRC
Code:

/* REXX */                                                           
Parse Upper Arg thejob .                                             
cntr = 0                                                             
Top:                                                                 
cntr = cntr + 1                                                       
rc = Time(R)                                                         
Do Forever                                                           
  n = Time(E)                                                         
  If n >= 10 Then Leave /* Wait 10 seconds */                         
End                                                                   
If cntr >= 6 Then Exit 4 /* Job Not showing on output queue */       
Drop out.                                                             
x = outtrap(out.)                                                     
"STATUS ("thejob")"                                                   
x = outtrap('OFF')                                                   
/* ************************************************ */                 
/* Message Format From the TSO STATUS command       */                 
/* IKJ56192I JOB JOBNAME#(JOBnnnnn) ON OUTPUT QUEUE */                 
/* ************************************************ */                 
Do i = 1 To out.0                                                     
  Parse Var out.i msgid 'JOB' jobname '(' jobid ')' stat               
  If Strip(stat) <> 'ON OUTPUT QUEUE' Then Signal Top                 
End                                                                   
dsname = jobname'.'jobid                                               
"OUTPUT "jobname"("jobid") PRINT("dsname") BEGIN HOLD KEEP"           
filename = dsname'.OUTLIST'                                           
"ALLOC DD(output) DA("filename") SHR REU DELETE"                       
"EXECIO * DISKR output (STEM jobstat. FINIS"                           
"FREE DD(output)"                                                     
Do i = 1 To jobstat.0                                                 
  Parse Var jobstat.i 2 themsg therest                                 
  If themsg = 'IEF142I' Then Say Strip(therest)                       
End                                                                   
Exit 0                                                                 
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
Search our Forums:

Back to Top