how to eliminate the duplicates in sorting

Answers were Sorted based on User's Feedback



how to eliminate the duplicates in sorting..

Answer / seema dawlekar

WE CAN ELIMINATE DUPLICATES IN SORTING BY SORT UTILITY
SYNTAX IS
SORT FIELDS=(STARTING POSITING,LENGTH,TYPE,A),EQUALS
SUM FIELDS=NONE

THIS WILL SORT THE FIELDS IN ASCENDING ORDER AND ELIMINATES
ALL THE DUPLICATES, AS WE ARE GIVING 'EQUALS' IT WILL TAKE
THE FIRST RECORD AND ELIMINATES REST OF THE DUPLICATE
RECORDS IN A FILE.

Is This Answer Correct ?    10 Yes 0 No

how to eliminate the duplicates in sorting..

Answer / muttaiah

use the Sort utility, In the instream data of the sort card
Specify.
//sysin dd *
sort fields=copy
sum fields=none,xsum
/*
for this you need to have a dd stmt as
//sortxsum dd dsn=datasetname, disp=(createnew, share)

Now, the output file will have the records without
duplicates & the duplicates will be captured in the above
dsn of the sortxsum dd.

Correct me if i'm wrong

Is This Answer Correct ?    3 Yes 1 No

how to eliminate the duplicates in sorting..

Answer / 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

how to eliminate the duplicates in sorting..

Answer / pandu

Hi Seema Thank you for answered my question but in my view
there is no sum i.e i don't want sum if there is
esalary.suppose one table contains 'Pandu' name more than
times but i want prient only one time.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More JCL Interview Questions

What is condition checking in jcl? Is this possible?

0 Answers  


How do You skip a Step In JCL?

9 Answers   HTC,


what are the technical terms for // /* in jcl

3 Answers   Cap Gemini,


The maximum number of in-stream procedure you can code in any JCL is ?

5 Answers  


MOD, DELETE; What does a disposition of (,DELETE) mean ?

3 Answers  






do we need to mention the location of catalogued procedure for each it's call in a single job?

1 Answers  


how to resolve the soc4 error?

5 Answers   ITC Infotech,


How is a GDG base created?

5 Answers  


There is a procedure in A.B.PROCS(PROC1) (member name is PROC1) //PROCA... There is a call to a procedure PROCA from a JOB. //STEP01 EXEC PROCA ... Here "PROCA" in JOB refers to the actual PROC name or the member name of the PDS where this PROCA is stored.

2 Answers   Merrill Lynch,


Can we use COND=EVEN on a job card, when jobs are scheduled through scheduler?

1 Answers   L&T,


diff bw SB37,SD37,SE37 ?( bcz these 3 belongs Space related abends only)

4 Answers   RBS,


Explain about LMCLOSE�close a data set

1 Answers  


Categories