Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
JES2 job Return code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
ykishore

Active User


Joined: 12 Aug 2005
Posts: 53
Location: USA

PostPosted: Fri Aug 12, 2005 6:10 pm    Post subject: JES2 job Return code
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
References
shivashunmugam Muthu

Active User


Joined: 22 Jul 2005
Posts: 114
Location: Chennai

PostPosted: Fri Aug 12, 2005 6:28 pm    Post subject: Re: JES2 job Return code
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

Moderator Team Head


Joined: 26 Apr 2004
Posts: 3314
Location: Charlotte,NC USA

PostPosted: Fri Aug 12, 2005 11:59 pm    Post subject: Re: JES2 job Return code
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 Hours
Page 1 of 1