--- Gil...here u go
**** before add of records ***** BROWSE SFORD.TEST.FILE Line 00000000 Col 001 080 ********************************* Top of Data ********************************** line1 line2 line3 line4 line5 line6 line7 ******************************** Bottom of Data ******************************** /* Rexx */ /* */ /* Clist: REXXINS */ /* Author: Scott Ford, IDF */ /* Date : 10-16-2008 */ /* Version: 1.0 */ /* Modification: 1.0 */ /* Release: 1.0 */ /* Narative: Input flat file and insert records */ /*---------------------------------------------------*/ reci = 0; j = 1; call alloc_input; call read_input; call insert_input; exit alloc_input: address TSO 'PROFILE NOPREFIX' 'ALLOC DDN(FILEIN) MOD DSN(SFORD.TEST.FILE)' if rc = 0 then do; say 'REXXINS -- File allocated ok - at 'date(u)' 'time() end; return; read_input: 'execio * DISKR FILEIN (STEM A. FINIS' if rc = 0 then do; say 'REXXINS -- File read ok - at 'date(u)' 'time() end; return; insert_input: B. = ''; j = 1; do i=1 to A.0; if substr(A.i,1,5) = 'line3' then do; parse var A.i record reci = i B.j = 'line3a' j = j + 1 B.j = 'line3b' 'execio '2' DISKW FILEIN ( STEM B. FINIS' say rc end; end; return; ***** after addition of records ***** BROWSE SFORD.TEST.FILE Line 00000000 Col 001 080 ********************************* Top of Data ********************************** line1 line2 line3 line4 line5 line6 line7 line3a line3b ******************************** Bottom of Data ******************************** Scott Ford Senior Systems Engineer [p] 678.266.3399 x304 [m] 609-346-0399 identityforge.com This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately or let us know at [EMAIL PROTECTED] or [EMAIL PROTECTED], and then delete the original. Any other use of the email by you is prohibited. -----Original Message----- From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf Of Paul Gilmartin Sent: Thursday, October 16, 2008 8:05 PM To: IBM-MAIN@BAMA.UA.EDU Subject: Re: How to insert records using EXECIO On Thu, 16 Oct 2008 18:53:48 -0400, Scott Ford wrote: >I understand what you said, my comments are that an insert was also very >doable in rexx..no more no less. > I'm intrigued. Can you point us to some sample code? or is this just the copy-append-rename already posted a couple times in this thread? -- gil ---------------------------------------------------------------------- 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 ---------------------------------------------------------------------- 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