|POL|SERVICING |CONVG |
|STS|AGENT |EFF DATE|
===============================
IL |A |021 |20080128|
MI |A |002 |20080110|
CT |A |036 |20080208|
CT |A |266 |20080117|
AK |A |723 |20080107|
NM |A |874 |20080107|
MD |A |876 |20080114|
CA |A |244 |20080102|
MA |A |499 |20080225|
The 361-362 colums hold the US state code. Now my requirement is to find out how many records are there for each state code. Ihave first used a control card like the following -
//SYSIN DD *
INREC FIELDS=(1,424,425:C'000001')
SORT FIELDS=(361,2,CH,A)
INCLUDE COND=(361,2,CH,NE,C' ',AND,361,2,CH,NE,C'==')
SUM FIELDS=(425,6),FORMAT=ZD
OUTREC FIELDS=(1:361,2,3:C' - ',6:425,6)
Here the output is coming in the following ways -
AK - 000001
AL - 000029
AR - 000013
AZ - 000032
CA - 000242
CO - 000028
CT - 000070
The output records are sorted in the alphabetical order of the state code. However, I wanted to see output in the ascending order of the number of occurence rather than the alphabetic order which came. I could not get it done as it requires two sorting in the single step.
Can anyone help me out with this requirement, I can not use more than one step, which is making the simple problem into a complex one.
