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
 

 

[SORT]Comparing/Merging(Overlaying) 2 rows within same File

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
pulsar

New User


Joined: 08 Nov 2007
Posts: 7
Location: India

PostPosted: Wed Apr 06, 2011 12:22 pm    Post subject: [SORT]Comparing/Merging(Overlaying) 2 rows within same File
Reply with quote

I have a single FB file of length 80 bytes.
File1:
Record Layout:
Key;StartDate;EndDate
Code:

AAA;2009-01-01;2009-12-31    <---row1
AAA;2008-01-01;2008-12-31    <---row2
AAA;2007-01-01;2007-12-31    <---row3
AAA;2005-09-08;2006-10-05    <---row4
BBB;2010-01-01;2011-01-31    <---row5

Expected Output:
Code:

AAA;2007-01-01;2009-12-31    <---combination of row1,3
AAA;2005-09-08;2006-10-05    <---row4
BBB;2010-01-01;2011-01-31    <---row5

The logic here is to see if the Key(first 3 bytes) is same, then check if the dates have continuity in them (i.e There is 'no gap' between Start date of row1 and end date of row2).
Will it be possible to use Sort - or will have to stick to COBOL to achieve the same. Please help.
(Sort Installed in Shop:Syncsort)
Thanks !
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10277
Location: italy

PostPosted: Wed Apr 06, 2011 12:25 pm    Post subject: Reply to: [SORT]Comparing/Merging(Overlaying) 2 rows within
Reply with quote

the other topic has been deleted!
Back to top
View user's profile Send private message
pulsar

New User


Joined: 08 Nov 2007
Posts: 7
Location: India

PostPosted: Wed Apr 06, 2011 12:29 pm    Post subject:
Reply with quote

Thanks enrico.
Have learnt the lesson !
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10277
Location: italy

PostPosted: Wed Apr 06, 2011 12:56 pm    Post subject: Reply to: [SORT]Comparing/Merging(Overlaying) 2 rows within
Reply with quote

not a problem! icon_biggrin.gif
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am


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