Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to split the record based on some keys?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to split the record based on some keys?
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    Post subject: Re: How to split the record based on some keys?
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

Site Director


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

PostPosted: Tue Aug 14, 2007 9:54 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us