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: 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: 1755
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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