how to eliminate the duplicates in sorting

Answer Posted / stu

Pandu,

Answers 1 & 3 are correct. SUM FIELDS tells SORT that only
1 record with the the same values in the SORT FIELDS will be
written to the SYSOUT. SUM FIELDS=NONE tells SORT there are
no fields to SUM, but only keep one record for each distinct
combination of the sort fields.

Examples:
SORT FIELD=1,5,CH,A) SORT FIELD=1,5,CH,A)
SUM FIELDS=(7,1,ZD) SUM FIELDS=NONE,EQUALS

----+----1 ----+----1
PANDU 1 PANDU 1
PANDU 4 PANDU 4
CRAIG 3 CRAIG 3
PANDU 3 PANDU 3
HARPO 6 HARPO 6

results in
----+----1 ----+----1
CRAIG 3 CRAIG 3
HARPO 6 HARPO 6
PANDU 8 PANDU 1

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can return codes be tested before execution of a job step?

923


How to submit jcl through a cobol program?

679


When output dataset space is required, what quantity categories are used?

830


if we want to use a gdg which is already created by some job, then how to use the reference of the last generation in a jcl?

1616


Explain dfsort utility?

673






Explain the purpose of dd dummy statement?

671


What is jcl in mainframe, and how many types of jcl statements are there for a job?

631


what is DSN in JCL and what are the parameters to declare the DSN?

718


What do you understand by jcl?

627


How to pass data to a program that is coded in an exec statement?

826


How to do automated restart when a job abend?

791


How to find the UNIT and VOLUME of a (a) KEPT (b) UNCATALOGED and (c) CATALOGED dataset - using (i) JCL and using (ii) ISPF ?

2171


I need exexution process for JCL programs

1850


Explain the function of //jcllib statement?

705


How to run cobol program using jcl?

650