Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
This works for me from what I understood of your request, although for testing purposes only I used an 80 byte record, changing your field at 196 into 26 for my test.
Code:
SORT FIELDS=(19,2,A,26,2,A),FORMAT=CH
SUM FIELDS=NONE
OUTFIL FILES=01,INCLUDE=(5,6,CH,EQ,C'202205',AND,19,2,CH,EQ,C'40'),
OUTREC=(1:19,2,3:26,2)
OUTFIL FILES=02,INCLUDE=(5,6,CH,EQ,C'202205',AND,19,2,CH,EQ,C'42'),
OUTREC=(1:19,2,3:26,2)
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
gcicchet wrote:
Hi Kolusu,
is it really necessary to sort the selected records, wouldn't the first occurrence of "40" and "42" do the trick ?
Gerry
gcicchet,
I think it is the combination of 2 fields which makes it unique 19,2 and 196,2
ex :
Code:
40 AA
42 AA
40 AA
40 AA
42 BB
42 BB
40 CC
So unless you sort , how can you eliminate duplicates? If the data is already sorted on the above 2 keys , then yes SELECT operator can be used to pick the FIRST overriding the sort with sort fields=copy.