Clarification Needed in Sorting



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

Re: Clarification Needed in Sorting

Postby gowthamgyaa » Thu Oct 04, 2012 8:42 pm

Thank you very much nicc.


Kind regards
gyaa
gowthamgyaa
 
Posts: 101
Joined: Wed Sep 05, 2012 11:18 pm
Has thanked: 67 times
Been thanked: 0 time

Re: Re: Clarification Needed in Sorting

 

Re: Clarification Needed in Sorting

Postby dick scherrer » Thu Oct 04, 2012 8:43 pm

Hello,

Have the sort control statements now been changed to match the data? Has this run successfully?

If yes, please post your working solution. If there is still a problem, post what is the problem?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Clarification Needed in Sorting

Postby gowthamgyaa » Thu Oct 04, 2012 8:48 pm

Hi Dicc sherrer,
Thanks for your kind reply.
Actually sorting is been done correctly but sum field's is the one which i cant clearly understand.
In the above mention JCL statements when i use sumfields its summing both MEC and MMM.
Kindly guide me in this.


Kind regards
gyaa
gowthamgyaa
 
Posts: 101
Joined: Wed Sep 05, 2012 11:18 pm
Has thanked: 67 times
Been thanked: 0 time

Re: Clarification Needed in Sorting

Postby NicC » Thu Oct 04, 2012 8:53 pm

IF your SUM FIELDS is specifying 4,2 as per your original post then it will sum ' MMM' and ' MEC' (note the blanks before the first Ms) because column 4 for 2 characters is ' M' for both records. if you really mean to sort on column 5 for 2 characters then the only records that will sum are the 2 CSE records which would give 2227.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
gowthamgyaa (Thu Oct 04, 2012 10:06 pm)
NicC
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: Clarification Needed in Sorting

Postby dick scherrer » Thu Oct 04, 2012 9:31 pm

Hello,

In the above mention JCL statements when i use sumfields its summing both MEC and MMM.
The process is SUMming as you coded. It can only do what we tell it. To get the answer you want, you need to correct the positions you specify for the SORT/SUM.
Hope this helps,
d.sch.

These users thanked the author dick scherrer for the post:
gowthamgyaa (Thu Oct 04, 2012 10:06 pm)
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Clarification Needed in Sorting

Postby skolusu » Thu Oct 04, 2012 9:48 pm

gowthamgyaa,

Use the following DFSORT JCL. I assumed that your input is RECFM=FB . If your input RECFM is VB or V then you may need to add 4 bytes to the actual positions as the first 4 bytes have the RDW.
//STEP0100 EXEC PGM=SORT   
//SYSOUT   DD SYSOUT=*     
//SORTIN   DD *           
----+----1----+----2----+--
001 CSE 1005               
002 ECE 1111               
008 MEC 1007               
014 CSE 1222               
0777AAA 1453               
088 SSS 1000               
015 MMM 1005               
//SORTOUT  DD SYSOUT=*     
//SYSIN    DD *           
  OPTION ZDPRINT           
  SORT FIELDS=(5,3,CH,D)   
  SUM FIELDS=(9,4,ZD)     
//*


The output from this is
088 SSS 1000
015 MMM 1005
008 MEC 1007
002 ECE 1111
001 CSE 2227
0777AAA 1453
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

These users thanked the author skolusu for the post:
gowthamgyaa (Thu Oct 04, 2012 10:06 pm)
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Previous

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post