Discussion:
DFSORT question MERGE w/SUM FIELDS=NONE
(too old to reply)
Frank Yaeger
2008-01-15 17:26:54 UTC
Permalink
(Sorry if this appears twice - the first post seems to be taking forever to
get to the list, so I thought I'd try again.)
The manual is unclear on this. First question: Is this supported? I.e.
Yes, SUM FIELDS=NONE is supported for MERGE.
will SORTOUT contain only one of the records with the duplicate key?
Yes.
Second question: Which record will be kept? Random, the one read from
the lowest SORTINnn or the one read from the highest SORTINnn DD
statement?
If EQUALS is in effect, it will be the one from the lowest SORTINnn. So
if you have:

...
//SORTIN01 DD ...
//SORTIN02 DD ...
//SYSIN DD *
OPTION EQUALS
MERGE FIELDS=(...)
SUM FIELDS=NONE

or

...
//SORTIN02 DD ...
//SORTIN01 DD ...
//SYSIN DD *
OPTION EQUALS
MERGE FIELDS=(...)
SUM FIELDS=NONE

the SORTIN01 record will be kept for duplicates.

If NOEQUALS is in effect, it's random.

Frank Yaeger - DFSORT Development Team (IBM) - ***@us.ibm.com
Specialties: PARSE, JFY, SQZ, ICETOOL, IFTHEN, OVERLAY, Symbols, Migration

=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Dave Kopischke
2008-01-15 17:27:54 UTC
Permalink
Does either product support sorting on N keys and eliminating all but
the first record with the first M (<N) values identical? E.g. for all
records with identical Names, keep only the one with the most recent
Date.
An awkward solution would be to sort it in date sequence first, then SORT
dedupe. Multiple passes and not very elegant. But for a small file, who cares ??
I've faced this problem with Unix sort(1). It doesn't specify which
record will be retained, so I must pipe into an awk(1) script to do
the final selection. Will DFSORT operate on Unix files?
Check out SYNCSORT for UNIX. It's been a decade or so, but I'm pretty sure
EQUALS is supported in SYNCSORT for UNIX. And it supports positional/variable
length sort fields too. Very cool.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Loading...