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

What is jcl in mainframe?

682


which parameter is use to declare the name of dataset in dd statement?

724


what is the purpose of coding class parameter in job statement?

709


What are the rules employed while naming the steps in a job?

650


What are the parameter we cannot use in procedure? How many instream we can write in single jcl?

577






List the various advantages of using jcl language?

841


what is DSN parameter and DISP parameter is used for?

669


1) SORT FIELDS=(20,4,CH,D,10,3,CH,D) OUTREC FIELDS=(7:20,4,C' FUTURE ',20,2,10,3,1Z,1,9,13,7, 24,57,TRAN=LTOU,6X'FF') This example illustrates how a fixed-length input data set can be sorted and reformatted for output. The SORTIN LRECL is 80 bytes. The reformatted output records are fixed length with a record size of 103 bytes. SOLRF (the IBM-supplied default) is in effect, so unless the SORTOUT LRECL is specified or available, it will automatically be set to the reformatted record length of 103. in the above example i have some doubts that a) sort fields=(20,4,CH,D,10,3,CH,D) -what exactly it does and this fields related to output record fields or input record fields b)outrec used to refprmat the records after sorting that means could please reply me as soon as possible Thanks. Venkat

7073


Is it possible to code instream data in a PROC?

742


I want my job (careerride) to be executed in 1 minute and 2 seconds. How do I do that?

705


Is condition checking possible in jcl?

710


What methodology can be adapted to transfer data to a program that is coded using the exec statement?

600


Are there any set of rules for the names of the steps used in a job? What are they?

610


what happens in conversion stage in job processing?

721


Is it possible to left uncode disp? If yes, how?

701