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 do you code a null statement?

1013


Many jcl statements contain specific values designed to direct and control the execution of the statement. What are these fields called?

962


how you can direct the data to spool using SYSOUT option?

1152


when can a job time-out occur? How to overcome that?

959


How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?

901


Is automatic restart possible in jcl? If yes, how?

837


In job processing, what happens in execution stage?

889


How to pass the parameter in parm using linkage section ? (syntax)?

849


How to read and write a single record into a file. I would like to use it to enter a single 8-character piece of information and use it to put it into a variable for processing in JCL. Thank you

802


How to alter the parameters for the existing gdg?

913


I HAVE A VB BLOCK WHICH IS USED AS INPUT IN COBOL CONATINING SOME RECORDS CAN I CHANGE THE FILE FROM VB TO FB?

2308


How to resolve the error "WER488A JOIN CAPACITY EXCEEDED" I am using SYNCSORT with JOINKEYS to compare 2 files. I am Getting error - > WER488A JOIN CAPACITY EXCEEDED There are 2 files to be compared with about 2 million records each. LRECL is 3665. Can somebody give a pointer as to how to resolve this problem? I am using SYNCSORT with JOINKEYS to compare 2 files. I am Getting error - > WER488A JOIN CAPACITY EXCEEDED There are 2 files to be compared with about 2 million records each. LRECL is 3665. Can somebody give a pointer as to how to resolve this problem?

8069


When you specify multiple datasets in a JOBLIB or STEPLIB, what factor determines the order?

1133


Explain the jcl exec statement?

862


What do you understand by jcl?

812