first 10 digits are set-id . The number of records in one set are variable.
16 pos - 3 bytes are type of record. -- 010 is the person info.
32 pos - 2 bytes are the role of the person
if the role is 02 (pos 32) - pos 107 - 3 bytes has the allocation.
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2
000000000000000000000ANN
00000000300000100000001N
00000000300000200000002N
00000000400000100000001N
00000000400000200000002N
BEER11440000000101000000100000003YPP Chicken J
BEER11440000000201000000200000007YPNBRUCE D JENNER
BEER11440000000301000000300000001NPP Chicken J
BEER11440000000401000000400000002NPP Alice J JENNER 030
BEER11440000000501000000500000002NPP Alexis E JENNER 070
BEER11440000000601000000600000012NPNEstate of Chicken J Perdue
BEER11440000000701000000700000014NPP Chicken J
BEER114400000008015000001000000522738130 0100 NNNNNNNN0
BEER114400000009015000002000000475848840 0100 NNNNNNNN0
BEER114400000010020000001000000522738130 1200203000000{0
BEER11440000001131000000100000002D20150528000000000015692{000000000000000{
BEER11440000001231000000200000002D20150628000000000015692{000000000000000{
BEER1144000000134000000010000009920150609201606080000000020150609208206
NEAT26691000000101000000100000003YPP Andrew Bourdean
NEAT26691000000201000000200000007YPP MARK Bourdean
NEAT26691000000301000000300000001NPP Andrew Bourdean
NEAT26691000000401000000400000001NPP Christianne
NEAT26691000000501000000500000012NPNBourdean Kids Irrev Trust
NEAT26691000000601000000600000002NPP Christianne Bourdean 100
NEAT26691000000701000000700000014NPP Alan and Christianne Bourdean
NEAT266910000008015000001000000293606780 0100
NEAT266910000009015000002000000570258837 0100
NEAT266910000010020000001000000293606780 120020
NEAT266910000011020000002000000565532184 120020
000000999000000000000000000000030
I want to keep the records in the set togather.
With that said, want to sort the
(a) Name Asc (starting 47 - 60 chars.)
(b) Allocation desc - (starting 107 - 3 bytes)
expected output :
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2
000000000000000000000ANN
00000000300000100000001N
00000000300000200000002N
00000000400000100000001N
00000000400000200000002N
BEER11440000000101000000100000003YPP Chicken J
BEER11440000000201000000200000007YPNBRUCE D JENNER
BEER11440000000301000000300000001NPP Chicken J
BEER11440000000501000000500000002NPP Alexis E JENNER 070
BEER11440000000401000000400000002NPP Alice J JENNER 030
BEER11440000000601000000600000012NPNEstate of Chicken J Perdue
BEER11440000000701000000700000014NPP Chicken J
BEER114400000008015000001000000522738130 0100 NNNNNNNN0
BEER114400000009015000002000000475848840 0100 NNNNNNNN0
BEER114400000010020000001000000522738130 1200203000000{0
BEER11440000001131000000100000002D20150528000000000015692{000000000000000{
BEER11440000001231000000200000002D20150628000000000015692{000000000000000{
BEER1144000000134000000010000009920150609201606080000000020150609208206
NEAT26691000000101000000100000003YPP Andrew Bourdean
NEAT26691000000201000000200000007YPP MARK Bourdean
NEAT26691000000301000000300000001NPP Andrew Bourdean
NEAT26691000000401000000400000001NPP Christianne
NEAT26691000000501000000500000012NPNBourdean Kids Irrev Trust
NEAT26691000000601000000600000002NPP Christianne Bourdean 100
NEAT26691000000701000000700000014NPP Alan and Christianne Bourdean
NEAT266910000008015000001000000293606780 0100
NEAT266910000009015000002000000570258837 0100
NEAT266910000010020000001000000293606780 120020
NEAT266910000011020000002000000565532184 120020
000000999000000000000000000000030
I put in a seq# and name and alloc togather and tried to sort it. It pushed the 02 record that had the allocation towards the bottom.
Sample sysin
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,110Z,5)),
IFTHEN=(WHEN=INIT,
OVERLAY=(5:115,10,15:SEQNUM,8,ZD,23:87Z)),
IFTHEN=(WHEN=(131,3,ZD,EQ,000,OR,131,3,ZD,EQ,001,OR,
131,3,ZD,EQ,002,OR,131,3,ZD,EQ,003,OR,
131,3,ZD,EQ,004),
OVERLAY=(5:C'AAAAAAAAAA')),
IFTHEN=(WHEN=(131,3,ZD,EQ,010,AND,146,2,ZD,EQ,02),
OVERLAY=(23:161,60,221,3)),
IFTHEN=(WHEN=(131,3,ZD,EQ,999),
OVERLAY=(5:C'ZZZZZZZZZZ'))
SORT FIELDS=(5,10,CH,A,
23,60,CH,A,
25,3,ZD,D,
15,8,ZD,A)
OUTREC BUILD=(1,4,111)
/*
What else should I do to keep the set to gather and order other than the allocation records.
Please guide.
Thanks
AK