How to find the number of duplicates in a file using Sort?

Answers were Sorted based on User's Feedback



How to find the number of duplicates in a file using Sort?..

Answer / abhijit saha

Hope this JCL explains your query
//COUNTDUP JOB ,'COUNT DUPLICT',
// MSGCLASS=Q,CLASS=D,
// NOTIFY=&SYSUID
//STEP010 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=ABCXYZ.UTIL.TEST,DISP=SHR
//RPT DD SYSOUT=*
//TOOLIN DD *
OCCUR FROM(IN) LIST(RPT) NOHEADER BLANK -
ON(1,2,CH) ON(VALCNT,U04)
/*

INPUT: ABCXYZ.UTIL.TEST
AB
AB
AB
DC
DC
PQ
PQ

Output:
AB 3
DC 2
PQ 2

Is This Answer Correct ?    17 Yes 10 No

How to find the number of duplicates in a file using Sort?..

Answer / prachi

In order to copy eliminated duplicates into another file
using sort is as below:

//SORTXSUM DD DSN=----
:
:
:
:
//SYSIN DD *
SORT FIELDS = copy
SUM FIELDS =NONE,XSUM
/*
//

Is This Answer Correct ?    7 Yes 4 No

How to find the number of duplicates in a file using Sort?..

Answer / divya reddy

we can sort it simply by using a command called" DF-sort"

Is This Answer Correct ?    0 Yes 0 No

How to find the number of duplicates in a file using Sort?..

Answer / sudha

//
//
//
//sysin dd *
sort fields=(1,4,ch,a)
sum fields=none/all
/*
for avoiding duplicates

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More JCL Interview Questions

Explain about REXX

1 Answers  


What do you feel makes a good program?

1 Answers  


how many types of sorts are there in jcl?

2 Answers   IBM,


What is the difference between BLKSIZE and LRECL?

3 Answers  


How is a new GDG coded?

2 Answers  






How does jcl act on code(if you take a cobol program)?

0 Answers  


if we have a job consist of two steps and each step calling a proc having 10 steps each then how many steps are counted only 2 or 22(10+10+1+1)? can we have more than 255 steps in a single job?

5 Answers   Accenture,


When concatenating two PDS can any one PDS can have empty dataset i.e without any value(Dummy).

2 Answers  


after submiting the jcl.how do you know that the job has been completed.

4 Answers   ACS,


How to get cursor position from system in CICS environment ?

8 Answers  


How do you overcome this limitation ?

0 Answers  


how do u define a file in cobol and jcl ?

2 Answers   TCS,


Categories