Splitting a file using a string

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
RRealities
Member
Posts: 3
Joined: Mon Jun 15, 2009 4:02 pm

Splitting a file using a string

Post by RRealities » Mon Jun 15, 2009 4:11 pm

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.

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Mon Jun 15, 2009 10:42 pm

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

RRealities
Member
Posts: 3
Joined: Mon Jun 15, 2009 4:02 pm

Post by RRealities » Tue Jun 16, 2009 11:09 am

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.

Code: Select all

.
.
PROCEDURE DIVISION
MAIN-PARA
.
.
SUB_PARA
.
.
Modified source code.

Code: Select all

.
.
PROCEDURE DIVISION
MAIN-PARA
DISPLAY 'MAIN-PARA'
.
.
SUB-PARA
DISPLAY 'SUB-PARA'
.
.
Other O/P file should contain the program name and all the paragraph names in the procedure division of the source program.

Regards,
RRealities.

skolusu
Member
Posts: 43
Joined: Sat Jul 26, 2008 12:38 am

Post by skolusu » Wed Jun 17, 2009 6:23 am

RRealities,

I answered your question on the other helpboard. Please do NOT post the same question in multiple forums.
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

RRealities
Member
Posts: 3
Joined: Mon Jun 15, 2009 4:02 pm

Splitting a file using a string

Post by RRealities » Wed Jun 17, 2009 3:50 pm

Hi,

sure, will not be repeated.

Regards,
RRealities.

Post Reply

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



Other References
Mainframe Tools and others