IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to split the record based on some keys?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vinay upadhyay

New User


Joined: 13 May 2007
Posts: 14
Location: chennai

PostPosted: Tue Aug 14, 2007 9:35 pm
Reply with quote

Hi All,

I have a requirement. i need to split a record (having 254 characters) if any of the following case occurs.
1) After every 90 characters
2) There is a set of strings say 'XYZ', 'ABC', 'PQR' etc.
At any ocurance of a perticular string say 'XYZ' , from this set of strings.

If the record breaks due to 2nd reason then the new sentence has to begin from the foresaid string. i.e. i have to retain the string in the beginning of the new line.

Please help.....

Vinay
Back to top
View user's profile Send private message
vinay upadhyay

New User


Joined: 13 May 2007
Posts: 14
Location: chennai

PostPosted: Tue Aug 14, 2007 9:38 pm
Reply with quote

Hi,
Let me make the specification more clear.

I would give a sample of input and expected output.
Case1:
Input can be:
World is a beautiful place.....<90 char>Save the planet earth....<90 char>Good morning...<30 char>
Expected output:the above line string should be split in three lines as follows.
World is a beautiful place.....<90 char>
Save the planet earth....<90char>
Good morning...<30 char>

Case2:
Input can be:
World is a beautiful place XYZ save the planet earth ABC Good morning.
Expected output:
World is a beatuiful place
XYZ save the planet earth
ABC Good morning.

recfm is FB for both input and putput and lrecl is 254 for input and 90 for output.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Aug 14, 2007 9:54 pm
Reply with quote

Hello,

It may help if you post more complete examples and use data lengths of 50/20 rather than 254/90 (once you have something that does what you want, changing the length to the longer length should be trivial). If you create sample input and expected output using the shorter lengths it will be much easier for you to post and for us to read & work with. When you post the input and output, please use the "Code" tag near the top of the reply panel. This will preserve embedded blanks and is much easier to read. To make sure your post will appear as you want, click Preview. When you are satisfied with your post, then Submit.

Why are ABC and XYZ "special"? How many of these special values will the process need to look for as a delimiter? Will these special values always be the same length? What is the chance that some value that is a delimiter might be actual data in some other place in the input text?
Back to top
View user's profile Send private message
Saroj Tripathy

New User


Joined: 05 Mar 2007
Posts: 23
Location: India

PostPosted: Mon Aug 27, 2007 11:46 am
Reply with quote

using INSPECT verb with reference modification may help.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top