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 are the rules employed while naming the steps in a job?

659


which parameter is used to check the syntax of a jcl without executing it?

798


How can the disposition of sysout datasets be set for an entire jobstream?

838


Explain the function of //cntl statement?

656


What is the function of job statement in jcl?

636






Explain the function of the steplib dd statement?

644


what is a jcl?

687


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

694


Is condition checking possible in jcl? If yes, how?

737


have in 100 records in a file i want to read first 3 records and skip next 3 records and agan i want to read 3 records and again i want to skip 3 records... run a loop from record one to 10 evaluate i/3 if comes even then skip else write to output file

923


what is the resolution for sb37 error

7706


Brief description of inline procedure of jcl.

682


What happens if both JOBLIB & STEPLIB is specified ?

607


what is the purpose of coding notify parameter in job statement?

683


What are the 2 types of parameters in dd statement?

646