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: 1738
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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