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
Explain the function of //cntl statement?
Explain about ISPF/TSO Commands
How can unused space allocation be returned to the system when a dataset is closed?
What is the format of comment statement?
How is the record format of an output dataset specified?
How to execute 2nd and 4th steps among 5 steps in jcl proc?
why should SYSIN DD * statement should not be included inside a PROCedure snippet??? please answer this.. i need to know.
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?
What is the difference between the positional and keyword parameters? Give examples.
What is jcl in mainframe?
Name a few IBM utility programs, and explain its function.
In job processing, what happens in conversion stage?
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
What is the purpose of dd?
Mainframes gets a text file that contains the name of the file. Now using JCL i want to locate that file name in the mainframe system and perform further processing. Please tell how to proceed