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
sort on accending order and display the count.
- 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.
Bodhi,
What's your condition here? It seems like u r counting all occurrences of field-2.display the record count for a particular condition
Arun
Re: sort on accending order and display the count.
Yes, I am counting all the occurrences of the field-2.
Bodhi
Bodhi
Re: sort on accending order and display the count.
Hi Bodhi,
Following JCL should help you...
Thanks,
lal
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
Re: sort on accending order and display the count.
Thank you Lal it is working fine for me.
Bodhi
Bodhi
-
- Similar Topics
- Replies
- Views
- Last post
-
-
How To display the count based on a specific string?
by Chintu333 » Fri Aug 19, 2022 12:59 am » in DFSORT/ICETOOL/ICEGENER - 3
- 2141
-
by sergeyken
View the latest post
Fri Aug 19, 2022 8:52 pm
-
-
- 3
- 3724
-
by naveenkumar sudha
View the latest post
Mon May 09, 2022 10:15 pm
-
-
SUM and count of records by key, using SORT utility
by naveenkumar sudha » Mon May 09, 2022 10:11 pm » in DFSORT/ICETOOL/ICEGENER - 2
- 6549
-
by ssbylzh
View the latest post
Sat May 21, 2022 5:10 pm
-
-
-
COBOL SORT - How to sort entire file first & sort by Key
by k_ekam » Thu Dec 01, 2022 12:58 pm » in IBM Cobol - 3
- 1574
-
by Robert Sample
View the latest post
Wed Dec 07, 2022 7:32 am
-
-
- 2
- 2391
-
by Murali_721
View the latest post
Thu Nov 19, 2020 4:24 pm