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

How to send data from cobol program to jcl?

2 Answers   CSC,


once we submitted the job to the operating system, how can we cancel the job before execution?

2 Answers  


Can we able insert data into a PS file Using IEBUPDTE utility??? If Yes can anyone describe it please..

1 Answers  


How do you overcome this limitation ?

0 Answers  


Is automatic restart possible in jcl?

0 Answers  






IF WE GIVE COND on step3 then, What does the following mean ? And Just adding to that, All the below COND are VALID as per the specifications. (i) COND = (8,LT,step1,step2) ---(AND/OR ?) (ii) COND = (8,LT,step1,step2, ONLY), (iii) COND = (8,LT,step1,ONLY) will it execute only if this condition is true or only if step1 ABENDS ? (iv) COND = (8,LT,step1,step2,EVEN), (v) COND = (8,LT,step1,EVEN) ?

2 Answers   IBM,


What does the one advantange of using IEBUPDTE?????

2 Answers  


01 GROSS-PAY 05 BASIC-PAY PIC 9(5) 05 ALLOWENCES PIC 9(3) if BASIC-PAY has a value 1000 and ALLOWENCES has a value of 250,what will be displayed by the statement DISPLAY GROSS-PAY a.1250 b.01000250 c.01250 d.1.250

1 Answers  


whats SOC7?

1 Answers   Patni,


What dd statement is used to supply the name of a dataset?

0 Answers  


How does jcl specify the job to the operating system?

0 Answers  


what is “Cond= even” and “Cond=only”?

0 Answers  


Categories