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

how do you code a null statement?

0 Answers   IBM,


Suppose i have a file with 10 recs and i want to skip only the 7 th record and copy the rest into another file. How do i do it using SORT?

7 Answers   VS, Wipro,


Explain how can the attributes of one sms dataset be copied to another dataset?

0 Answers  


Suppose I have Five Steps in PROC In this Case I want to Execute third Step in PROC using Main JCL don't use any COND Explain with Coding Thanks & Regards SHREE

4 Answers   Merrill Lynch,


What is the difference b/w the CLASS,TIME,PRTY in jcl job card.

4 Answers   Syntel,






what is the purpose of SYSOUT parameter in the DD statement?

1 Answers  


The disp in the JCL is MOD and the program opens the file in OUTPUT mode. What happens ? The DISP in the JCL is SHR and the program opens the file in EXTEND mode. What happens ?

3 Answers  


Suppose I have seven jobs to do, but I want to hold one than how can I do this?

1 Answers  


Can you code instream data in a PROC ?

10 Answers  


Hi, can we call catalog( say myproc } proc n times in jcl if so how please explain Thanks in advance

2 Answers   Cap Gemini,


how to write a jcl prog to copy alternate recs from ps1 to another ps2,suppose ps1 having 10 recs?

2 Answers   Steria, TCS,


how to identify the file used in the JCL is an VSAM file. Just seeing the JCL code how can we track the file as VSAM file?

6 Answers   CSC,


Categories