Hi All,
I need to write a Rexx script which inserts/deletes lines in a particular way.
The sequential file would already have some text data in it.
My requirment is like this.
1) I need to insert lines just before a string (lets say 'Thanks')
ex:-
HI,
THE FOLLOWING ERRORS ARE FOUND.
THANKS,
MR.PROTAGONIST
So the new lines should be inserted between the strings 'THE FOLLOWING ERRORS ARE FOUND' and 'THANKS,'
2) When I submit my rexx script for the 2nd time, first these newly inserted lines sholud be deleted and then new set of lines should be inserted.
Note:
These new set of lines which are inserted/deleted are not constant in number. They can be 2,4,8 or any other number. The only thing that's constant is, these lines are always inserted before a particular string(here 'THANKS,')
Thanks in advance
REXX to insert/delete lines in a sequential file.
Moderators: Veera, Moderator Group
-
- Member
- Posts: 1
- Joined: Tue Apr 16, 2013 4:14 pm
REXX to insert/delete lines in a sequential file.
Thanks,
Mr.Protagonist
Mr.Protagonist
I think the first pass sounds relatively straight-forward. Read one record at a time. If the record does not contain the value of "THANKS," then write it out again. If it does, write out the data to be inserted, then continue on like before.
For the second pass, I'm not sure. Can you somehow mark the records that have been inserted on the first pass so you can identify them here?
For the second pass, I'm not sure. Can you somehow mark the records that have been inserted on the first pass so you can identify them here?
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page