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 concatinating datasets?

1 Answers  


How jcl work to handle various input output file operations?

0 Answers  


A statement about PROCs is " In PROCs, Symbolic Parameters can be assigned on PROC and EXEC", BUT On which EXEC, (i) On the JCL's EXEC which is calling to PROC1. (Inside JCL, EXEC PROC1) (ii) or On the PROC's EXEC where it calls the PGM1. (Inside PROC, EXEC PGM=PGM1)

2 Answers   IBM,


Can anyone tell me the syntax for printing two files at two different destinations in a single step?

3 Answers  


While using SORT FILES =NONE,XSUM I am getting error "ICE172A E XSUM IS NOT SUPPORTED - USE ICETOOL SELECT IF APPROPRIATE"..I want to write duplicate records a a serparte file..how i can do tht?

3 Answers   Steria,






What is the use of DSNDB07 ?

1 Answers  


How to rename a VSAM file as well as it's index file?

4 Answers   CitiGroup,


what does mvs stand for?

1 Answers   IBM,


What is timing concept in mainframe?

0 Answers  


when does a dataset go uncataloged?

0 Answers   IBM,


Explain in DD statement what is the use of DCB parameter?

0 Answers  


Why include statement is used in a jcl?

0 Answers  


Categories