sort on accending order and display the count.

Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL
bodhi
Posts: 52
Joined: Mon Jul 30, 2007 5:01 pm

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

User avatar
arcvns
Posts: 55
Joined: Sat Feb 28, 2009 12:36 am
Skillset: COBOL, JCL, SYNCSORT, VSAM, DB2
Referer: Nobody
Location: India
Contact:

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

bodhi
Posts: 52
Joined: Mon Jul 30, 2007 5:01 pm

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

lal
Posts: 24
Joined: Thu Aug 13, 2009 10:06 pm
Skillset: Cobol
Referer: Online

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...

Code: Select all

//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

bodhi
Posts: 52
Joined: Mon Jul 30, 2007 5:01 pm

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


  • Similar Topics
    Replies
    Views
    Last post