Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Output file is coming out to be empty

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Output file is coming out to be empty
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: 8593
Location: Back in jolly old England

PostPosted: Mon Apr 13, 2009 1:35 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Apr 13, 2009 3:15 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Apr 13, 2009 3:30 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Apr 13, 2009 3:52 pm    Post subject:
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    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Tue Apr 14, 2009 3:03 am    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Tue Apr 14, 2009 12:53 pm    Post subject: Reply to: Output file is coming out to be empty
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us