how to use the aggrigate function in sort

IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

how to use the aggrigate function in sort

Postby muthu455 » Tue Apr 24, 2012 5:30 pm

i need to use the aggregate function in sort card
this is my input file
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000001 000051 05 VIVEK CHENNAI TAMILNADU 0012 3000
000002 000052 06 RAKEE BANGLOR KARNATAKA 0013 4000
000003 000053 07 KALAI PONDY PONDICHER 0014 5000
000004 000054 08 HARIS SALEM TAMILNADU 0015 6000
000005 000055 09 AJITH TRICH TAMILNADU 0016 7000
000006 000056 04 RAJIN GOA MAHARASTA 0017 8000
000007 000057 03 VIJAY PUNE MAHARASTA 0018 9000
000008 000058 02 VIKRA NOIDE DELHI 0019 5000

And My jcl is

//SORTOUT DD DSN=xxxxxxxx.VIVEK.PS8,...

i have used this jcl .. i did't have seen any change in my output
so help me how can i use the sum fields in sort field....
Posts: 21
Joined: Sat Apr 14, 2012 3:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to use the aggrigate function in sort


Re: how to use the aggrigate function in sort

Postby NicC » Tue Apr 24, 2012 5:42 pm

Why should we? You have totally ignored requests in other posts to put your data and JCL in code tags to make them more readable. If you want help you are going to have to help us make it easier to read your post.

What was the output that you got and what did you expect? And use the code tags.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Global moderator
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: how to use the aggrigate function in sort

Postby BillyBoyo » Tue Apr 24, 2012 5:47 pm

You have'nt specified any "key" for the SUM to be done with.

The DFSORT manuals are on the web. Have you looked at them?
Global moderator
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: how to use the aggrigate function in sort

Postby Frank Yaeger » Tue Apr 24, 2012 11:28 pm


You must tell use a SORT or MERGE statement to tell DFSORT which key you want to use for the SUM. DFSORT ignores SUM for a COPY operation since there's no key to look for duplicates. For example, if you want to SUM your fields for duplicate keys in positions 11-15, you would use:

   SORT FIELDS=(11,15,CH,A)
   SUM FIELDS=(1,6,ZD)

It's not obvious from your input example which fields you want to use as keys.

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: ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) -
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at

These users thanked the author Frank Yaeger for the post:
admin (Wed May 02, 2012 12:02 pm)
User avatar
Frank Yaeger
Global moderator
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times



  • Related topics
    Last post