Hi,
I have to split my file in to 2 by searching a string.
Consider that my I/P file is a cobol source code.
I have to split it in to 2 files. one should contain all the records up to PROCEDURE DIVISION of the I/P file and the other should contain all the records after PROCEDURE DIVISION.
Once splitted need to get the source pgm name from file 1 and write it in to a file and extract all the paragraph from the 2 nd file and append it to the program name written file.
kindly post your ideas ASAP.
Regards,
RRealities.
Splitting a file using a string
Moderators: Frank Yaeger, Moderator Group
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Please show an example of the records in the input file and what you expect for output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of all relevant fields.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
-
- Member
- Posts: 3
- Joined: Mon Jun 15, 2009 4:02 pm
Hi Frank,
Thanks for your reply and I am sorry that I can't make my requirement clear.
Here is my requirement.
I have a cobol source code as my I/P file with record length 80 & FB.
I have to write 2 o/p files.
one O/P file should contain modified source code by introducing display statements of the paragarph names after the start of each paragraph like the example below.
Source code.
Modified source code.
Other O/P file should contain the program name and all the paragraph names in the procedure division of the source program.
Regards,
RRealities.
Thanks for your reply and I am sorry that I can't make my requirement clear.
Here is my requirement.
I have a cobol source code as my I/P file with record length 80 & FB.
I have to write 2 o/p files.
one O/P file should contain modified source code by introducing display statements of the paragarph names after the start of each paragraph like the example below.
Source code.
Code: Select all
.
.
PROCEDURE DIVISION
MAIN-PARA
.
.
SUB_PARA
.
.
Code: Select all
.
.
PROCEDURE DIVISION
MAIN-PARA
DISPLAY 'MAIN-PARA'
.
.
SUB-PARA
DISPLAY 'SUB-PARA'
.
.
Regards,
RRealities.
-
- Member
- Posts: 3
- Joined: Mon Jun 15, 2009 4:02 pm
Splitting a file using a string
Hi,
sure, will not be repeated.
Regards,
RRealities.
sure, will not be repeated.
Regards,
RRealities.
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