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
What is the maximum length of a single line of jcl?
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?
How can a stopped job be started again?
Explain the jcl exec statement?
How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?
How to submit jcl through a cobol program?
in ways data can be passed to a COBOL program from JCL?
Must tape dataset definitions include vol=ser specifications?
How do you create a temporary dataset?
how can you check if a file is empty using jcl?
What is the function of //jcllib statement?
is there any way to execute more than one proc in the same exec statement at the same time..?
What is the function of the dd mgmtclas keyword in sms datasets?
When you specify multiple datasets in a JOBLIB or STEPLIB, what factor determines the order?
Can I share my data with other jobs? How?