5 pts.
Q:
How to sort a variable length file, with multiple record types
12345     101xxxxxxxx

12345     201xxxxxxxx1

12345     201xxxxxxxx2

12346     104xxxxxxxx

12346     204xxxxxxxx1

12347     101xxxxxxxx

12347     201xxxxxxxx1

 

Above is an example of a file I am trying to sort.  I want to sort by the 2nd and 3rd characters, of the right table (01, 04, etc).  The first character in the right table is a record type (1 or 2)  The last character in the right table is a sequence number, which only applies to the 2 type records.  For each 1 type record, there are up to 6 corresponding and related 2 type records, which must follow the type 1 records, in sequence order, (1-6)  The sort field (01, 04, etc) is common to both types of records, and in the same byte locations, but come in a file where they are not sequentially ordered.  How can I sort this, so that the sort field I want is in ascending order, but yet the type 2 records that correspond are kept in sequential order, below each type 1 type record?



Software/Hardware used:
IBM Z/OS DFsort utility
ASKED: Nov 25 2009  6:35 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2645 pts.
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • Bookmark and Share
you want to SORT two "tables" together -

I do not understand what you are asking. tables? as in DB2 tables? Or you asking about sort as in SYNCSORT? I
Last Answered: Dec 15 2009  2:26 PM GMT by Meandyou   2645 pts.
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _