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

Hi Please try to be to-the-point. 1) How to INCLUDE a JCL segment in a JOB ? (A Small example) 2) What is SPOOL and what is SPOOL FULL ? and how to direct the output of a Jobstep to SPOOL ?

3 Answers   IBM,


What statement can be used to send data to another mvs jes3 node?

0 Answers  


please could u tell me the difference between SORT, SYNCSORT,CA-SORT, DFSORT,

1 Answers   IBM,


i have a jcl in which 4 & 5 step creates a new generation. 4th step output is as input for the 6th step & 5th step output is used as input in the 7th step. How they are refered as in the 6th & 7th steps? If the job abends in 6th step then how the 5th step output is refered in 7th step?

1 Answers   IBM,


What you mean by skeleton JCl?

2 Answers  






Hello Guys, I have 1+ Year Experience in MAINFRAME TESTING. After 1 Week I have an Interview With a Company on Mainframe Testing. Please Could You Guys Please Suggest me What Sections Should I prepare ?? ___Tell Me the Topic Or Appropriate Site & Links. ?? ---------------Thank You

0 Answers   IBM,


Explain about LMCLOSE�close a data set

1 Answers  


How is a dataset passed from one step to another?

2 Answers   DELL,


What is STEPLIB, JOBLIB? What is it used for?

2 Answers  


i have a jcl calling proc which has 10 steps, i want to execute from step5 to step10, where can i code RESTART and COND parameter?

4 Answers   IBM,


In jcl i have 255 steps. In 255 step i declared proc. In proc i have 20 steps this job is executable or not? why?

4 Answers  


There are 2PROCS in a JCL. I want following conditions to be carried out 1) 1st PROC should be executed as such In second PROC 2) First 4steps should not be executed 3) 5th step should not be executed 4) 6th and 7th step should be executed The change should be done only in the JCL and PROC should be untouched ?

3 Answers   ADP,


Categories