Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 22
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: 1786
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: 22
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 Find a string in PS file opened in br... mukkas CLIST & REXX 2 Sat Feb 24, 2018 2:15 pm
No new posts eliminate dups in VB file anatol DFSORT/ICETOOL 6 Tue Feb 13, 2018 2:59 am
No new posts Tape file issue abdulrafi JCL & VSAM 2 Thu Feb 08, 2018 12:01 pm
No new posts COB2 file processing rizwanaccy COBOL Programming 8 Tue Jan 02, 2018 1:00 pm
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us