How to get the RC of JCL(submitted by REXX) in REXX



IBM's Command List programming language & Restructured Extended Executor

How to get the RC of JCL(submitted by REXX) in REXX

Postby Y Harikumar » Wed Aug 24, 2011 11:38 am

Hi All,

I have a requirement where I need to capture the RC of JCL in REXX.
Could you please someone help me???

I have written a REXX program and in this REXX program I am submitting a JCL using file tailoring process (skeleton).
Now, jcl is getting submitted successfully, but i am unable to find the RC of the submitted JCL in Main REXX program.
My main REXX program should continue only after the submitted JCL completes.

Now, How do I send the RC of JCL to the main REXX program?

Please advise.
Y Harikumar
 
Posts: 6
Joined: Mon Aug 15, 2011 9:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to get the RC of JCL(submitted by REXX) in REXX

Postby dick scherrer » Wed Aug 24, 2011 12:28 pm

Hello,

My main REXX program should continue only after the submitted JCL completes.
Please advise.
Advise you to come up with a new direction. . .

Well managed systems will not permit this.

What business reason is there for a batch job to "send" an rc back to the process that submitted it?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to get the RC of JCL(submitted by REXX) in REXX

Postby Y Harikumar » Wed Aug 24, 2011 1:33 pm

Hi,
We are developing a REXX tool [EOS restoring tool] for the customer.
ok, now,
REXX program will search for a jobname in one of the PS file (with a particular date) and if found, I will submit the JCL using temp JCL using REXX.
Once the temp JCL completes, I should search for the same job name in another PS file ( with another date), then I should submit temp JCL second time.. and so.. on.. until the date is equals to TODATE ( which is capturing as input).

Hope I have given useful info to your query.

please help.
thank you....
Y Harikumar
 
Posts: 6
Joined: Mon Aug 15, 2011 9:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to get the RC of JCL(submitted by REXX) in REXX

Postby NicC » Wed Aug 24, 2011 2:55 pm

Clear as mud...it almost sounds as though you want the rexx program to have the return code of the step that is executing the code. However, the step return code is not issued until the rexx program finishes and the step finishes
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: How to get the RC of JCL(submitted by REXX) in REXX

Postby MrSpock » Wed Aug 24, 2011 3:26 pm

I'd suggest that you capture the step return-code(s) from within the job itself, write that to a common log file, then use that.

Otherwise you will. of course, have to write an interface into your JES output and retrieve those details from there.
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: How to get the RC of JCL(submitted by REXX) in REXX

Postby mongan » Wed Aug 24, 2011 6:27 pm

The way I understand it is you will submit a job, so submit the job with conditional JCL to react to your return codes from the job. Then when the job completes successfully you invoke your rexx again (in batch). I do not know how else you plan on doing it, a rexx should not wait for a job to finish because you will be waisting resources.
User avatar
mongan
 
Posts: 211
Joined: Tue Jan 11, 2011 8:32 pm
Has thanked: 1 time
Been thanked: 5 times

Re: How to get the RC of JCL(submitted by REXX) in REXX

Postby Y Harikumar » Thu Aug 25, 2011 11:44 am

thank you.
Y Harikumar
 
Posts: 6
Joined: Mon Aug 15, 2011 9:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to get the RC of JCL(submitted by REXX) in REXX

Postby expat » Sun Aug 28, 2011 2:17 pm

A restore job ................................ Maybe you should review the current strategy of backup / recovery which is (hopefullY already in place. rather than faffing about with REXX after REXX after REXX
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: How to get the RC of JCL(submitted by REXX) in REXX

Postby JPVRoff » Mon Nov 07, 2011 11:38 am

We use similar examples of this code to get the return codes of all the steps in a submitted job and pick the baddest one. We use similar things written in COBOL. This is the code for the procedure to obtain the return code only (returns '1' if bad, '0' if good, OKRC is the highest permitted return code). We've used these to write simple job schedulers. Possibly it was this that the OP was lokking for?
GetHighStep:cvt=storage(10,4);ascb=storage(224,4)                     
ascb_jbni=c2x(storage(d2x(c2d(ascb)+172),4))                           
ascb_jbns=c2x(storage(d2x(c2d(ascb)+176),4))                           
assb=storage(d2x(c2d(ascb)+336),4);asxb=Storage(D2x(c2d(ascb)+108),4) 
acee=Storage(D2x(c2d(asxb)+200),4);jsab=storage(d2x(c2d(assb)+168),4) 
asid=storage(d2x(c2d(ascb)+36),2);psatold=storage(21C,4)               
jscb=storage(d2x(c2d(psatold)+180),4);jct=storage(d2x(c2d(jscb)+260),4)
sct=storage(d2x(c2d(jct)+48),3);pnt=0                                 
do forever;if sct=0 then exit 12;pnt=pnt+1                     
  sctansct=storage(d2x(c2d(sct)+36),3)                                 
  sctsname.pnt=storage(d2x(c2d(sct)+68),8)                             
  sctpgmnm.pnt=storage(d2x(c2d(sct)+124),8)                             
  sctabcnd.pnt=x2b(c2x(storage(d2x(c2d(sct)+176),1)))                   
  sctstend.pnt=x2b(c2x(storage(d2x(c2d(sct)+188),1)))                   
  if \substr(sctstend.pnt,1,1)then sctsexec.pnt=0                       
  else sctsexec.pnt=c2d(storage(d2x(c2d(sct)+24),2));sct=sctansct       
  if substr(sctstend.pnt,1,1)&\substr(sctstend.pnt,2,1) then leave;end 
OKRC=8;highRC=0;abend=0;step=                   
do while pnt>1;pnt=pnt-1;if substr(sctabcnd.pnt,6,1) then do           
    abend=1;step=strip(sctsname.pnt);end                           
    if sctsexec.pnt>highRC&\abend then do;highRC=sctsexec.pnt             
    step=strip(sctsname.pnt);end;end;
if abend then return="ABEND";else return=HighRC                       
sysid=storage(d2x(c2d(cvt)+340),4);jobid=storage(d2x(c2d(jsab)+20),8) 
user=Storage(d2x(c2d(acee)+21),7)                                     
if ascb_jbns=0 then jobname=storage(ascb_jbni,8)                       
else jobname=storage(ascb_jbns,8)                                     
if jobname='INIT' then jobname=storage(d2x(c2d(jsab)+28),8)           
say 'JOB:'jobname 'USER:'user 'JOBID:'jobid 'Step:'step 'HighRC:'return
if abend|highRC>OKRC then return 1;else return 0


The JCL gets invoked using this JCL:
//MESSAGE  EXEC PGM=IKJEFT01,DYNAMNBR=1635,COND=EVEN,
// PARM='ISPSTART CMD(%????????)'                   
//STEPLIB  DD   DSN=...............,DISP=SHR         
//SYSEXEC  DD   DSN=............,DISP=SHR           
//SYSTSPRT DD   SYSOUT=*                             
//SYSTSIN  DD   DUMMY                               
Regards,
Jonathan

"Calm down, it's only ones and zeros" © Kathy Mar, 1985
User avatar
JPVRoff
 
Posts: 14
Joined: Mon Nov 07, 2011 11:15 am
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post