View previous topic :: View next topic
|
Author |
Message |
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
Hi,
I have got following requirement:
A file has Duplicate records, and it looks like this
Code: |
POLA CERT1
POLA CERT1
POLA CERT1
POLB CERT2
POLB CERT2
POLB CERT2
POLB CERT2
|
now, I need to have output file like this
Code: |
POLA CERT1 3
POLB CERT2 4
|
So basically ,we are writing the number of duplicate records ?
Please note that we need to do this with DFSORT, no ICETOOL. |
|
Back to top |
|
|
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
Forgot to mention the RECFM and LRECL.
They are 80 and FB respectively
Thanks |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT job like the following to do what you asked for. I assumed the records are in sorted order as shown in your example. If not, replace OPTION COPY with a SORT statement.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
POLA CERT1
POLA CERT1
POLA CERT1
POLB CERT2
POLB CERT2
POLB CERT2
POLB CERT2
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(1,11,
TRAILER3=(1,11,25:COUNT=(M10,LENGTH=5)))
/*
|
|
|
Back to top |
|
|
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
Thanks !! As usual , It worked perfectly. |
|
Back to top |
|
|
|