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
 

 

deduplicating on matching keys / remaining record sums field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Wilsy

New User


Joined: 29 Dec 2007
Posts: 5
Location: UK

PostPosted: Wed Apr 09, 2008 4:26 pm    Post subject: deduplicating on matching keys / remaining record sums field
Reply with quote

Here is a simplified example of what I need.
I have four records on aN INPUT file as follows

D155555000030000200001
D166666000040000800007
D155555000020000400005
D166666000090001200246

I need to merge the records on the first 7 characters but at the same time sum three fields in positions 8 for 5, 13 for 5 and 18 for 5.
The OUTPUT file would then look like this

D155555000050000600006
D166666000130002000253

Any help with the statements required to achieve this is much appreciated.
Wilsy
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: Wed Apr 09, 2008 8:44 pm    Post subject:
Reply with quote

Wilsy,

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
D155555000030000200001
D166666000040000800007
D155555000020000400005
D166666000090001200246
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  SORT FIELDS=(1,7,CH,A)
  OPTION ZDPRINT
  SUM FIELDS=(8,5,ZD,13,5,ZD,18,5,ZD)
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
Wilsy

New User


Joined: 29 Dec 2007
Posts: 5
Location: UK

PostPosted: Wed Apr 09, 2008 9:05 pm    Post subject: Reply to: deduplicating on matching keys / remaining record
Reply with quote

Thanks Frank
I have downloaded the manuals. They are proving helpful with some other stuff I have to do. No "code changes" (except JCL) allowed at this stage of the project for some bizzare reason but I think you can do almost anything with these sorts. Very powerful software.
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 -> 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 Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


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