Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Previous record x current record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
jackare

New User


Joined: 27 Aug 2008
Posts: 33
Location: Brazil

PostPosted: Thu Nov 29, 2018 7:56 am    Post subject: Previous record x current record
Reply with quote

Hello!
I have a dsn SORTIN like:

Code:

001 100
002 005
003 125
004 500
007 250
008 010
010 001
100 020
128 120
129 012



Expected Output:

Code:

001 105
003 625
007 260
010 001
100 020
128 132



Explanation:
Layout
1,3 = ID
5,3 = Price

If ID of current record is equal ID of previous record plus 1 then sum two prices .
Sample:
SUM prices, sets: ( 1 , 2) = 105 and ( 3 , 5 ) = 625!

icon_sad.gif icon_eek.gif
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Nov 29, 2018 8:15 pm    Post subject:
Reply with quote

jackare,

I dont have Syncsort, but something like this should work for you.

- Set up groups of 2 records, Use WHEN=GROUP,RECORDS=2
- PUSH the ID of the 1st record onto the 2nd record.
- For each 2nd record in the group, Calculate the difference between the IDs and OVERLAY the ID at pos-1 with that from the 1st (PUSHed value), only when the difference between IDs is 1.
- Summarize the results in an OUTFIL (SECTIONS, TRAILER3..)

Good luck.
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need help in parsing record in VBA file guptae DFSORT/ICETOOL 4 Fri Oct 11, 2019 2:31 pm
No new posts Concatenate two files of variable rec... Thiru S DFSORT/ICETOOL 3 Wed Aug 21, 2019 11:53 pm
No new posts ALTERNATE RECORD KEY usage for KSDS AIX sophia.lee COBOL Programming 1 Thu Jul 25, 2019 7:28 am
This topic is locked: you cannot edit posts or make replies. Removing duplicate record based on th... Nilanjan Sikdar DFSORT/ICETOOL 4 Mon Jul 22, 2019 8:29 pm
No new posts Display current IMS region on an On-l... Time2Live IMS DB/DC 1 Fri May 03, 2019 1:59 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us