View previous topic :: View next topic
Author
Message
abin Active User Joined: 14 Aug 2006Posts: 198
Hi All,
I have to copy all duplicate records based on 12 fields from a file. Is there a straight way to achieve this.
My TOOLIN looks like this
//TOOLIN DD *
SELECT FROM(SORTIN) TO(SORTOUT) ON(740,20,CH) -
ON(415,03,CH) -
ON(50,08,ZD) -
ON(31,09,CH) -
ON(188,07,CH) -
ON(1112,11,CH) -
ON(1751,1,CH) -
ON(239,5,PD) -
ON(224,5,PD) -
ON(1105,5,PD) -
ON(445,5,PD) -
ON(181,5,PD) ALLDUPS
/*
When I searched the manual I found that more than 10 fields cannot be specified.
Thanks
Back to top
William Thompson Global Moderator Joined: 18 Nov 2006Posts: 3156 Location: Tucson AZ
Without looking it up, are you allowed a chance to inrec reformat and combine some if not all of the ON fields?
Back to top
abin Active User Joined: 14 Aug 2006Posts: 198
Hi Wiliam,
Thats right I did it that way. But wanted to know is there any way to do it direct, without the roundabout.
Thanks.
Back to top
William Thompson Global Moderator Joined: 18 Nov 2006Posts: 3156 Location: Tucson AZ
Maybe you will get your answer, but if the manual says that more than 10 fields cannot be specified, I doubt it will be different.....
Back to top
abin Active User Joined: 14 Aug 2006Posts: 198
When I tried it with 12 fields it gave me error
SYT002I "TOOLIN" INTERFACE BEING USED
SELECT FROM(SORTIN) TO(SORTOUT) ON(740,20,CH) -
ON(415,03,CH) -
ON(50,08,ZD) -
ON(31,09,CH) -
ON(188,07,CH) -
ON(1112,11,CH) -
ON(1751,1,CH) -
ON(239,5,PD) -
ON(224,5,PD) -
ON(1105,5,PD) -
ON(445,5,PD) -
ON(181,5,PD) ALLDUPS
SYT071E "SELECT" STATEMENT CONTAINS MORE THAN TEN "ON" OPERANDS
SYT030I OPERATION COMPLETED WITH RETURN CODE 12
SYT015I PROCESSING MODE CHANGED FROM "STOP" TO "SCAN" DUE TO OPERATION FAILURE
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
Your error is rather explicit. Syncsort will not accept more than 10.
One way would be to reformat the records so that your control fields are next to each other, run the process, then reformat the output to the original format.
You could also write a bit of code to get the output you need.
Back to top
abin Active User Joined: 14 Aug 2006Posts: 198
Hi All,
Thanks for the comments.
Abin.
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
You're welcome
Have you found something that works for you?
Back to top
abin Active User Joined: 14 Aug 2006Posts: 198
Hi,
This wil look childish. But we needed to get the duplicates for some analysis purpose so I first extracted duplicated records using
//SORTXSUM DD DSN=duplicate claims
// DISP=(NEW,CATLG,DELETE),
// UNIT=TESTDA,SPACE=(CYL,(1,10),RLSE),
// DCB=(MDLDSCB,RECFM=FB,LRECL=5000,BLKSIZE=0)
//SYSIN DD *
SORT FIELDS=(740,20,CH,A, **SUBR-CONT-NO-20
415,03,CH,A, **HOME-PLAN-AND-LOB
50,08,ZD,A, **PHAR-DISPEN-DTE-8
31,09,CH,A, **PRSP-NO-9
188,07,CH,A, **SUBR-CLM-PHAR-NO-ID
1112,11,CH,A, **NATL-DRUG-CD-ID
1751,1,CH,A, **DRUG-CLM-SOURCE-CD
239,5,PD,A, **CLM-BAL-AMT
224,5,PD,A, **DRUG-ORIG-AMT
1105,5,PD,A, **CLM-PAT-SHARE-AMT
445,5,PD,A, **SUBR-COPAY-AMT
181,5,PD,A) **GNRC-BRAND-VAR-COPAY-AMT
SUM FIELDS=NONE,XSUM
and then I extracted all duplicate records using the direct value of fields.
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
Hey! If it gets what you need, that wouldn't be childish
Good luck!
Back to top
Please enable JavaScript!