You can read the whole file into a stem variable, put the lines you want
to insert into a stack, and then loop though the first stem variable to
append the values to the stack and then write the file back.

/* rexx */                                                           
                                                                     
ADDRESS TSO                                                          
"ALLOC FI(TEMPNAME) DSN(your_file_name) SHR"                   
'EXECIO * DISKR TEMPNAME (STEM CARD.   FINIS'                        
Do y=1 to 3                                                          
outcard.y = your_new_records

End                                                                  
Do x = 1 to card.0                                                   
Y=y+1                                                                
outcard.y=card.x                                                     
End                                                                  
Push ''                                                              
'EXECIO 'y' DISKW TEMPNAME (stem outcard. FINIS'                     

Jon L. Veilleux 
[EMAIL PROTECTED] 
(860) 636-2683 


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
Behalf Of P.Sabarish Kannan
Sent: Thursday, October 16, 2008 7:22 AM
To: [email protected]
Subject: How to insert records using EXECIO

Hi

 I have a requirement to insert some records in the beginning of a file
where already some lines are existing . i tried using DISKW using MOD ,
but they are appending to the end. How do we insert in the beginning? I
am using REXX for this program.

Thanks in advance

Sabarish

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send
email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search
the archives at http://bama.ua.edu/archives/ibm-main.html

This e-mail may contain confidential or privileged information. If
you think you have received this e-mail in error, please advise the
sender by reply e-mail and then delete this e-mail immediately.
Thank you. Aetna   

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to