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
 

 

Reading from File 1 and Writing to File 2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
shiitiizz

New User


Joined: 12 Sep 2013
Posts: 19
Location: India

PostPosted: Thu May 14, 2015 5:49 pm    Post subject: Reading from File 1 and Writing to File 2
Reply with quote

I guess this might have got discussed earlier in this Forum but I could not get much info so posting for some assistance here.

I am having a PS File having records like
Code:

Alpha
Beta
Gamma


I need to read this file and write into anothr existing PS File in format
Code:

I AM WRITING Alpha
I AM WRITING Beta
I AM WRITING Gamma


I have a Rexx code written which is not giving any error, but not writing data into output file. Kindly correct me where am doing wrong, or point me to any link where I can refer to

Code:

/* REXX */                                                             
 ADDRESS "TSO"                                                         
        "ALLOC DA('W#E00G.LIST.MEM') F(INDD) SHR REUSE"                 
        "ALLOC DA('W#E00G.LIST.MEM.LMS') F(OUTDD) OLD REUSE"           
         SAY 'COPYING ...'                                             
          "EXECIO * DISKR INDD (FINIS STEM READ1"                       
          DO I = 1 BY 1 UNTIL I = 5                                     
            WRITED.I  = "I AM WRITING" || READ1.I                       
          END                                                           
          "EXECIO * DISKW OUTDD(FINIS STEM WRITED"                     
          SAY 'COPY COMPLETE'                                           
               "FREE F(INDD OUTDD)"                                     
         EXIT                                                           
Back to top
View user's profile Send private message

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1747
Location: Bloomington, IL

PostPosted: Thu May 14, 2015 6:21 pm    Post subject:
Reply with quote

Note that in EXECIO, both for input and output, there is a difference between varname and varname.; the former is not a stem. Change your STEM specifications.
Back to top
View user's profile Send private message
shiitiizz

New User


Joined: 12 Sep 2013
Posts: 19
Location: India

PostPosted: Thu May 14, 2015 6:37 pm    Post subject: Reply to: Reading from File 1 and Writing to File 2
Reply with quote

Thanks icon_smile.gif Worked well...

Code corrected as below:
Code:

/* REXX */                                                             
 ADDRESS "TSO"                                                         
        "ALLOC DA('W#E00G.LIST.MEM') F(INDD) SHR REUSE"                 
        "ALLOC DA('W#E00G.LIST.MEM.LMS') F(OUTDD) OLD REUSE"           
         SAY 'COPYING ...'                                             
          "EXECIO * DISKR INDD (FINIS STEM READ1."                     
          DO I = 1 BY 1 UNTIL I = 5                                     
            WRITED.I  = "I AM WRITING" || READ1.I                       
          END                                                           
          "EXECIO * DISKW OUTDD(FINIS STEM WRITED."                     
          SAY 'COPY COMPLETE'                                           
               "FREE F(INDD OUTDD)"                                     
         EXIT                                                           
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
No new posts Formating the Input file sreekusr DFSORT/ICETOOL 3 Fri Feb 17, 2017 10:40 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm


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