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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is 'mounting' of volumes ? Is there anything that a programmer can do in it ? How to find currently mounted volume ?

2007


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) ?

1762


What is job control language?

621


I want to join to input files and write the matching fields on to an output file but i dont want the output file a sorted one

1937


What is use of restart and how to use it?

783






Explain how can a stopped job be started again?

645


I HAVE A VB BLOCK WHICH IS USED AS INPUT IN COBOL CONATINING SOME RECORDS CAN I CHANGE THE FILE FROM VB TO FB?

2115


how do you access an uncataloged dataset in a jcl?

877


What are hierarchy levels in jcl?

965


What is the purpose of dd * statement in jcl?

821


How do you create a temporary dataset?

676


List in order the hierarchical levels of jcl?

679


how to do automated restart when a job abends?

858


Can we use DISP=SHR in output file in JCL

961


What is one line to pass PARM from JCL to COBOL?

1223