View previous topic :: View next topic
|
Author |
Message |
Sagarneel
New User
Joined: 13 Apr 2009 Posts: 7 Location: Kolkata
|
|
|
|
JCL To Execute A REXX Program
enrico-sorichetti wrote: |
no need to pass the dsname to the rexx script
when running in batch why complicate things
let the jcl allocate the dataset and refer to it by ddname...
interactive snippet ...
Address TSO ALLOC DA(...dsname...) FI(...ddname...)
Address TSO EXECIO * READ ...ddname...
batch snippet
jcl section
//...ddname... DD ...
REXX section
Address TSO EXECIO * READ ...ddname...
less work to be done in rexx, no need to allocate and check the result |
*************************************************************
Sorry to bother, but I tried doing this thing as you told. In fact I was simply trying to copy one file (INFILE) to another (OUTFILE) by this process. The problem is that the Output file is coming out to be empty.
This is the JCL snippet through which I'm running my REXX: (my user id is SD1)
//TSOBATCH EXEC PGM=IKJEFT1A,DYNAMNBR=200
//SYSEXEC DD DSN=SD1.UTIL.CLIST(JCLREX),DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//INFILE DD DSN=SD1.REX.INPUT,DISP=SHR
//OUTFILE DD DSN=SD1.REX.OUTPUT,DISP=SHR
//SYSTSIN DD *
PROFILE PREFIX(SD1)
This is the REXX snippet:
ADDRESS TSO "EXECIO * DISKR INFILE (FINIS STEM INPREC.)"
ADDRESS TSO "EXECIO * DISKW OUTFILE (FINIS STEM INPREC.)"
The O/P file is not being written properly. Can you suggest what might be going wrong in this case? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Have you tried running with TRACE |
|
Back to top |
|
|
Sagarneel
New User
Joined: 13 Apr 2009 Posts: 7 Location: Kolkata
|
|
|
|
expat wrote: |
Have you tried running with TRACE |
*******************************************************
I'm not sure if TRACE works with a REXX executed through a JCL.
As per your suggestion, I inserted a "TRACE ALL" at the beginning of the REXX and then executed it though the JCL. It just ran thorugh without showing any execution order. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
So where are you invoking the REXX program ? |
|
Back to top |
|
|
Sagarneel
New User
Joined: 13 Apr 2009 Posts: 7 Location: Kolkata
|
|
|
|
expat wrote: |
So where are you invoking the REXX program ? |
***********************
//TSOBATCH EXEC PGM=IKJEFT1A,DYNAMNBR=200
//SYSEXEC DD DSN=SD1.UTIL.CLIST(JCLREX),DISP=SHR //SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//INFILE DD DSN=SD1.REX.INPUT,DISP=SHR
//OUTFILE DD DSN=SD1.REX.OUTPUT,DISP=SHR
//SYSTSIN DD *
PROFILE PREFIX(SD1)
The REXX routine JCLREX has been executed from the JCL. See the instruction in bold. That's where the REXX is being executed. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Quote: |
The REXX routine JCLREX has been executed from the JCL. See the instruction in bold. That's where the REXX is being executed. |
Yes, I know where the REXX is stored, but where is it invoked.
Please post the TRACE output from the run. |
|
Back to top |
|
|
Sagarneel
New User
Joined: 13 Apr 2009 Posts: 7 Location: Kolkata
|
|
|
|
If you are asking for the TRACE O/P of the REXX that was executed through the JCL then I'm not sure how to get that. As I said, I put a "TRACE ALL" at the beginning of the REXX routine but the execution order was not shown. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
May I suggest that you take some time to read the manuals, easy accessible from the "IBM Manuals" button at the top of each page, and pay attention to the parts that explain executing REXX in a batch job.
There, you will see examples of how to execute the REXX code. |
|
Back to top |
|
|
Sagarneel
New User
Joined: 13 Apr 2009 Posts: 7 Location: Kolkata
|
|
|
|
Thanks! Will do that! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
FWIW (once you learn how to initiate the rexx code), possibly the worst way to copy a file is by using rexx and execio. . . |
|
Back to top |
|
|
Sagarneel
New User
Joined: 13 Apr 2009 Posts: 7 Location: Kolkata
|
|
|
|
dick scherrer wrote: |
Hello,
FWIW (once you learn how to initiate the rexx code), possibly the worst way to copy a file is by using rexx and execio. . . |
*****************
That was just for testing purpose! I've other things to achieve with this little test rexx run! |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
Quote: |
ADDRESS TSO "EXECIO * DISKW OUTFILE (FINIS STEM INPREC.)" |
Code: |
ADDRESS TSO "EXECIO "inprec.0" DISKW OUTFILE (FINIS STEM INPREC.)" |
would be the proper format ...
EXECIO for write expects as second parameter the number of stem entries to be written |
|
Back to top |
|
|
Sagarneel
New User
Joined: 13 Apr 2009 Posts: 7 Location: Kolkata
|
|
|
|
Thanks a lot! "*" works just as fine though. Actually the problem was with invoking the REXX from JCL. I missed the SYSTSIN data wherein the JCL was to be invoked. This is the corrected JCL (with the missing data in bold):
//TSOBATCH EXEC PGM=IKJEFT1A,DYNAMNBR=200
//SYSEXEC DD DSN=SD1.UTIL.CLIST,DISP=SHR REXX PROGRAM LIBRARY
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//INFILE DD DSN=SD1.REX.INPUT,DISP=SHR
//OUTFILE DD DSN=SD1.REX.OUTPUT1,DISP=OLD
//SYSTSIN DD *
PROFILE PREFIX(SD1)
%JCLREX |
|
Back to top |
|
|
|