sort on accending order and display the count.



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

sort on accending order and display the count.

Postby bodhi » Mon Sep 14, 2009 3:09 pm

Hello All,

I have a file with the record count of 1000000 in which i need to sort the data on the accending order and then display the record count for a particular condition. Below is the example for better understanding:

Input file:
P AAAA
P AAAA
P AAAA
P BBBB
P BBBB
P CCCC
P DDDD


Output file:
AAAA 3
BBBB 2
CCCC 1
DDDD 1

Thanks
Bodhi
bodhi
 
Posts: 53
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: sort on accending order and display the count.

 

Re: sort on accending order and display the count.

Postby arcvns » Mon Sep 14, 2009 4:12 pm

Bodhi,

display the record count for a particular condition
What's your condition here? It seems like u r counting all occurrences of field-2.
Arun
User avatar
arcvns
 
Posts: 55
Joined: Sat Feb 28, 2009 12:36 am
Location: India
Has thanked: 0 time
Been thanked: 0 time

Re: sort on accending order and display the count.

Postby bodhi » Mon Sep 14, 2009 4:29 pm

Yes, I am counting all the occurrences of the field-2.

Bodhi
bodhi
 
Posts: 53
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: sort on accending order and display the count.

Postby lal » Tue Sep 15, 2009 8:18 pm

Hi Bodhi,
Following JCL should help you...

//SORTIN   DD *                                                     
P AAAA                                                             
P AAAA                                                             
P AAAA                                                             
P BBBB                                                             
P BBBB                                                             
P CCCC                                                             
P DDDD                                                             
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                     
  SORT FIELDS=(3,4,CH,A)                                           
  OUTFIL REMOVECC,NODETAIL,                                         
  SECTIONS=(3,4,TRAILER3=(3,4,5X,COUNT))                           
//*     


Thanks,
lal
lal
 
Posts: 24
Joined: Thu Aug 13, 2009 10:06 pm
Has thanked: 0 time
Been thanked: 0 time

Re: sort on accending order and display the count.

Postby bodhi » Wed Sep 16, 2009 5:55 pm

Thank you Lal it is working fine for me.

Bodhi
bodhi
 
Posts: 53
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post