Page 1 of 2

REXX RC in Batch

PostPosted: Fri Sep 10, 2010 2:00 pm
by pranabpathsk
Hi,

I have created a REXX to be run in batch. I have set Return Code for any error. But, irrespective of these return code, when the REXX is run through JCL, it is always giving Return Code as 0. Is there any way so that we the JCL will give return code as set in REXX ?

Re: REXX RC in Batch

PostPosted: Fri Sep 10, 2010 2:47 pm
by MrSpock
It should. Could you show how you call your exec in the JCL and how you've coded the exec.

Re: REXX RC in Batch

PostPosted: Fri Sep 10, 2010 11:11 pm
by NicC
I believe you have to execute it not through IKJEFT01 but one of the other flavours of IKJEFT - 1A perhaps??? You would have to read the manual to find out.

Re: REXX RC in Batch

PostPosted: Fri Oct 08, 2010 6:56 am
by sricsc
Hi All,

I tried to execute REXX Exec through JCL. In the REXX Exec, i'm doing the reading VSAM file & Writing into Seq. file. When i'm executing the REXX sepeartely, its running fine. When executing thru IEJKTF01, Job has ran sucessfully, but nothing has in O/P File.

Pls advise for me..

//TMP EXEC PGM=IKJEFT01,DYNAMNBR=30,REGION=4096K     
//SYSEXEC DD DSN=MYID.FDJ18.STATUS,DISP=SHR         
//SYSPRINT DD SYSOUT=*                               
//SYSTSPRT DD SYSOUT=*                               
//IN  DD DSN=MYID.ROR1.FDJ18.CL,DISP=SHR             
//OUT DD DSN=MYID.TEST.STATUS.A,DISP=OLD             
//SYSTSIN DD *                                       
PROFILE PREFIX(MYID)                                 
%START                                               


REXX ..

ADDRESS TSO "EXECIO" y.0 "DISKW OUT (FINIS STEM Y."   

Re: REXX RC in Batch

PostPosted: Fri Oct 08, 2010 7:01 am
by dick scherrer
Hello,

How are you "executing the REXX sepeartely"?

What does a trace show?

Re: REXX RC in Batch

PostPosted: Fri Oct 08, 2010 8:32 am
by sricsc
By using command EX before the member. Its runs fine & writing O/P in the PS File.

But its not working through JCL. So My doubt is writing the data (in the form of STEM Variables) is possible or not in the Batch.

Re: REXX RC in Batch

PostPosted: Fri Oct 08, 2010 9:01 am
by dick scherrer
Hello,

By using command EX before the member. Its runs fine & writing O/P in the PS File.
Is this EX in a batch job or an online tso/ispf session?

Is there some reason you have not run a trace of the problem run and posted what this shows (as requested earlier)?

Done correctly, stem variables work in batch.

Re: REXX RC in Batch

PostPosted: Fri Oct 08, 2010 10:05 am
by NicC
You show one line of rexx code. You do not show where Y. is being populated. How do you know that the rexx is running OK - IKJEFT01 does not pass on the return code from rexx.

Re: REXX RC in Batch

PostPosted: Fri Oct 08, 2010 11:06 am
by sricsc
Thanks for all. Its because of wrong stem variables usage. Problem has identified & solved with the help of trace. :P

Re: REXX RC in Batch

PostPosted: Sat Oct 09, 2010 12:51 am
by dick scherrer
Good to hear it is working - thank you for letting us know :)

d