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   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vinay upadhyay

New User


Joined: 13 May 2007
Posts: 14
Location: chennai

PostPosted: Sat Aug 11, 2007 6:40 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

dick scherrer

Site Director


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

PostPosted: Sat Aug 11, 2007 10:31 pm    Post subject:
Reply with quote

Hello,

Please post some sample input data and the expected output from that data.

Also, please include the recfm and lrecl of the both the input and output files. You mentioned 254 and 90 characters, but clarificatoin will help.
Back to top
View user's profile Send private message
vinay upadhyay

New User


Joined: 13 May 2007
Posts: 14
Location: chennai

PostPosted: Sun Aug 12, 2007 1:50 am    Post subject:
Reply with quote

Hi,
Thanks for response
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.

I think i am making my point clear.
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Sun Aug 12, 2007 5:24 am    Post subject:
Reply with quote

In the Sort control card you can use / character to write input record into multiple lines.
Back to top
View user's profile Send private message
vinay upadhyay

New User


Joined: 13 May 2007
Posts: 14
Location: chennai

PostPosted: Sun Aug 12, 2007 8:16 am    Post subject:
Reply with quote

Hi,

Devzee wrote:
In the Sort control card you can use / character to write input record into multiple lines.


This is not clear to me. can you please elaborate. an example will help. Moreover i have to split the records on basis of some strings also.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sun Aug 12, 2007 8:41 pm    Post subject:
Reply with quote

Quote:
I think i am making my point clear.


No, you're not. It's not clear when you want to use which rule, what the actual set of strings is, whether case1 and case2 are two different input files each with its own rules, or one input file with different sets of rules. Also, for case 1 you show the output as 90/90/30, but it would actually have to be 90/90/90 with the third record padded with blanks on the right.

Case 1 as shown could be done with these DFSORT control statements:

Code:

   OPTION COPY
   OUTFIL BUILD=(1,90,/,91,90,/,181,30)


Case 2 could probably be done with DFSORT's PARSE function, but how you would do it depends on the full set of rules and strings. For more information on DFSORT's PARSE function, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
Back to top
View user's profile Send private message
vinay upadhyay

New User


Joined: 13 May 2007
Posts: 14
Location: chennai

PostPosted: Mon Aug 13, 2007 10:23 pm    Post subject:
Reply with quote

Hi,

The 2 cases can be in the same input file.That is to say there can be two kind of records in the inputs file.

Frank Yaeger wrote:

Also, for case 1 you show the output as 90/90/30, but it would actually have to be 90/90/90 with the third record padded with blanks on the right.


This is correct.

Now there is change in the requirment.ppl want us to implement the logic in a pre existing program rather than using a sort step (which we thought of doing earlier).

How can we do it in a cobol pgm?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Aug 13, 2007 11:01 pm    Post subject:
Reply with quote

I'm closing this thread. Please start a new thread in the COBOL Forum.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
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


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