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

Output file is coming out to be empty


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sagarneel

New User


Joined: 13 Apr 2009
Posts: 7
Location: Kolkata

PostPosted: Mon Apr 13, 2009 1:10 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Apr 13, 2009 1:35 pm
Reply with quote

Have you tried running with TRACE
Back to top
View user's profile Send private message
Sagarneel

New User


Joined: 13 Apr 2009
Posts: 7
Location: Kolkata

PostPosted: Mon Apr 13, 2009 1:48 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Apr 13, 2009 3:15 pm
Reply with quote

So where are you invoking the REXX program ?
Back to top
View user's profile Send private message
Sagarneel

New User


Joined: 13 Apr 2009
Posts: 7
Location: Kolkata

PostPosted: Mon Apr 13, 2009 3:21 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Apr 13, 2009 3:30 pm
Reply with quote

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
View user's profile Send private message
Sagarneel

New User


Joined: 13 Apr 2009
Posts: 7
Location: Kolkata

PostPosted: Mon Apr 13, 2009 3:46 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Apr 13, 2009 3:52 pm
Reply with quote

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
View user's profile Send private message
Sagarneel

New User


Joined: 13 Apr 2009
Posts: 7
Location: Kolkata

PostPosted: Mon Apr 13, 2009 3:55 pm
Reply with quote

Thanks! Will do that!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Apr 14, 2009 3:03 am
Reply with quote

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
View user's profile Send private message
Sagarneel

New User


Joined: 13 Apr 2009
Posts: 7
Location: Kolkata

PostPosted: Tue Apr 14, 2009 10:57 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Apr 14, 2009 12:53 pm
Reply with quote

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
View user's profile Send private message
Sagarneel

New User


Joined: 13 Apr 2009
Posts: 7
Location: Kolkata

PostPosted: Tue Apr 14, 2009 1:12 pm
Reply with quote

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
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top