Page 1 of 1

Extract one instance of record.

PostPosted: Tue Oct 16, 2012 11:03 am
by Mehdi shri
Dear friend
I want a methode to extract one instance of records which contain same data on coloumn 11 to 15. For example if SORTIN like below:
ABCDE1000077001
BACDE1000077001
CBADE1000077001
DCBAE1000077002
EDCBA1000077002
ABCDE1000077003

Out put must be below:
ABCDE1000077001
DCBAE1000077002
ABCDE1000077003

Re: Extract one instance of record.

PostPosted: Tue Oct 16, 2012 11:50 am
by NicC
How about using
SUM FIELDS=NONE
?

Re: Extract one instance of record.

PostPosted: Tue Oct 16, 2012 11:51 am
by BillyBoyo
  MERGE FIELDS=(11,5,CH,A)
  SUM FIELDS=(NONE)

Re: Extract one instance of record.

PostPosted: Wed Oct 17, 2012 4:16 am
by BillyBoyo
A clarification:

You can use SUM with MERGE. You can use MERGE with one file. Therefore, if a file is in sequence already, MERGE with SUM will use less resources than SORT with SUM.

It is one of those things. "We" know that a file is in sequence before the step is run. SORT only knows when it has already read the last record, at the earliest.

If the file is not in sequence, MERGE will tell you, and you'll have to use SORT anyway.

You cannot use SUM with SORT FIELDS=COPY/OPTION COPY. You can specify it, but it won't do anything.

For the MERGE you will need to change SORTIN to SORTIN01. If you were merging, say, four files, they would be SORTIN01, ...02, ...03, ...04.