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 are instream data terminated?

3 Answers   Tech Mahindra,


what is the meaning of keyword in jcl?what is is opposite?

4 Answers  


can any one plzzzzzz tell the jcl code for creating ps using idcams

2 Answers   Fiserv,


What is notcat 2 - gs?

0 Answers  


Could you provide an example and its effect OF, Using COND on JOB and EXEC both ?

4 Answers   IBM,






describe the dd statement,its meaning,syntax and keywords?

1 Answers  


What is the exact difference between PRTY and DPRTY

2 Answers   iGate,


We can use PASS with permanent datasets also. THEN Which is the condition in which we may use PASS (instead of KEEP) with permanent data sets, while there is no need to specify UNIT and VOL for them like temporary data sets (in cas we use KEEP for permanent data sets) ?

0 Answers   IBM,


How can return codes be tested before execution of a job step?

0 Answers  


in jcl you are having JCLLIB and STEPLIB what happens

10 Answers   EDS, Wipro,


01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP VALUE 50 05 AMOUNT-2 PIC 9(4)V99 USAGE COMP MOVE ZERO TO GROUP-ITEM ADD 50 TO AMOUNT-1 what will be the content of AMOUNT-1? a.50 b.100 c.0 d.unpredictable

1 Answers  


How many positional parameters are there in job statement?

4 Answers  


Categories