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 the maximum length of a single line of jcl?

1023


Suppose there are 2 Input files Infile-1 and Infile-2. Both the Files contain Employee Records. You need to compare both the files and Write the Common Records in third file named Outfile. How can we do this using File-Aid?

2422


How can a stopped job be started again?

898


Explain the jcl exec statement?

853


How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?

879






How to submit jcl through a cobol program?

866


in ways data can be passed to a COBOL program from JCL?

855


Must tape dataset definitions include vol=ser specifications?

1311


How do you create a temporary dataset?

843


how can you check if a file is empty using jcl?

1040


What is the function of //jcllib statement?

1025


is there any way to execute more than one proc in the same exec statement at the same time..?

2327


What is the function of the dd mgmtclas keyword in sms datasets?

978


When you specify multiple datasets in a JOBLIB or STEPLIB, what factor determines the order?

1128


Can I share my data with other jobs? How?

844