Sorting Alphanumeric



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

Sorting Alphanumeric

Postby kumar4567 » Thu May 07, 2009 2:39 pm

Hi all,

I need to achieve the following using Sort card.

I/P:
0000034R098765A0012AS
0000034R0987659999999
000003400123340001010
000003499999999999999

I want to sort it in such a way that the record with '9999' comes at top. The first 7 places corresponds to ID1, next 7 places ID2, next 4 places ID3 and final 3 places ID4. The problem is that ID2, ID3, ID4 are all alphanumeric as mentioned above. The final O/P should look like...

O/P:
000003499999999999999
0000034R0987659999999
0000034R098765A0012AS
000003400123340001010

Please help me. Thanks in advance !!!

Regards,
Kumar
kumar4567
 
Posts: 1
Joined: Thu May 07, 2009 2:22 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sorting Alphanumeric

Postby Frank Yaeger » Thu May 07, 2009 9:25 pm

Your description of what you want to do is not clear.

You describe 21 bytes in your layout but your records show 22 bytes. So I'm guessing ID4 has a length of 4, not 3 as you stated.

I think you want to sort descending on ID4, but it's not clear what other fields you want to sort on and in what sequence (ascending or descending).

This DFSORT SORT statement would give you the output you say you want, but you haven't shown a good enough sample of input and output records for me to determine if that's what you really want to do:

  SORT FIELDS=(18,4,CH,D,1,17,CH,D)     


If that's not what you want, then describe how you want to sort on the other fields.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post