Below is the sample input record and the output expected
Is this is possible using a sort jcl?
INPUT: ABCXYZ.UTIL.TEST
AB
AB
AB
DC
DC
PQ
PQ
Output:
AB 3
DC 2
PQ 2
How to find the number of duplicates in a file using Sort?
Moderators: Frank Yaeger, Moderator Group
-
- Member
- Posts: 6
- Joined: Thu Jan 17, 2013 2:57 pm
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Member
- Posts: 3
- Joined: Tue Nov 27, 2012 3:11 pm
Re: How to find the number of duplicates in a file using Sor
ya it is possible by jcl sort ; & write jcl sort as a control card.
I given the example bellow
*************************************************************
//MAT007P JOB OZA,OZA,MSGLEVEL=(1,1),
// CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID,REGION=6M
//STEP EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=MAT004.PALLAVI.DUPNAME,DISP=SHR
//SORTOUT DD DSN=MAT004.PALLAVI.DUPNAME.OUT8,
// DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=28,RECFM=FB,BLKSIZE=280),
// SPACE=(TRK,(3,2),RLSE)
//SYSIN DD *
INREC FIELDS=(1,20,5X,C'001')
SORT FIELDS=(1,20,CH,A)
SUM FIELDS=(26,3,ZD)
OUTREC FIELDS=(1,20,5X,26,3)
/*
*************************************************************INPUT
*************************************************************
MAT004.PALLAVI.DUPNAME.
SINDU
MRUDULLA
PALLAVI
LAKSHMI
AKILA
MANASA
MADHAVI
AKILA
PALLAVI
AKILA
PALLAVI
MADHAVI
************************************************************* OUTPUT
*************************************************************
AKILA 003
LAKSHMI 001
MADHAVI 002
MANASA 001
MRUDULLA 001
PALLAVI 003
SINDU 001
*************************************************************
The above example is the perfect example to your post
I given the example bellow
*************************************************************
//MAT007P JOB OZA,OZA,MSGLEVEL=(1,1),
// CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID,REGION=6M
//STEP EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=MAT004.PALLAVI.DUPNAME,DISP=SHR
//SORTOUT DD DSN=MAT004.PALLAVI.DUPNAME.OUT8,
// DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=28,RECFM=FB,BLKSIZE=280),
// SPACE=(TRK,(3,2),RLSE)
//SYSIN DD *
INREC FIELDS=(1,20,5X,C'001')
SORT FIELDS=(1,20,CH,A)
SUM FIELDS=(26,3,ZD)
OUTREC FIELDS=(1,20,5X,26,3)
/*
*************************************************************INPUT
*************************************************************
MAT004.PALLAVI.DUPNAME.
SINDU
MRUDULLA
PALLAVI
LAKSHMI
AKILA
MANASA
MADHAVI
AKILA
PALLAVI
AKILA
PALLAVI
MADHAVI
************************************************************* OUTPUT
*************************************************************
AKILA 003
LAKSHMI 001
MADHAVI 002
MANASA 001
MRUDULLA 001
PALLAVI 003
SINDU 001
*************************************************************
The above example is the perfect example to your post
Arundk2012 wrote:Below is the sample input record and the output expected
Is this is possible using a sort jcl?
INPUT: ABCXYZ.UTIL.TEST
AB
AB
AB
DC
DC
PQ
PQ
Output:
AB 3
DC 2
PQ 2
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page