View previous topic :: View next topic
|
Author |
Message |
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
I have two files that have been sort together and am having a problem finding the appropriate SPLICE control cards to have them merged.
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7
GROUP1 X
FIELD1:AAAAAAAAAAAAAAAAAAAA:GROUP1 :RRRRRRRR:
FIELD1:BBBBBBBBBBBBBBBBBBBB:GROUP1 :RRRRRRRR:
FIELD1:CCCCCCCCCCCCCCCCCCCC:GROUP1 :AAAAAAAA:
FIELD1:DDDDDDDDDDDDDDDDDDDD:GROUP2 :UUUUUUUU:
FIELD1:EEEEEEEEEEEEEEEEEEEE:GROUP2 :AAAAAAAA:
FIELD1:FFFFFFFFFFFFFFFFFFFF:GROUP2 :RRRRRRRR:
GROUP3 Y
FIELD2:GGGGGGGGGGGGGGGGGGGG:GROUP3 :RRRRRRRR:
FIELD2:HHHHHHHHHHHHHHHHHHHH:GROUP3 :RRRRRRRR:
FIELD3:IIIIIIIIIIIIIIIIIIII:GROUP4 :RRRRRRRR:
FIELD3:JJJJJJJJJJJJJJJJJJJJ:GROUP4 :UUUUUUUU:
|
I want match on "GROUP? " in positions 29-36 and if they match..... the "X" or "Y" in position 47 should overlay the matched records. I also want to keep all the other records intact. The problem I am having is the records with GROUP2 or GROUP4 attempt to SPLICE according to field 29-36 and I lose records.
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7
FIELD1:AAAAAAAAAAAAAAAAAAAA:GROUP1 :RRRRRRRR:X
FIELD1:BBBBBBBBBBBBBBBBBBBB:GROUP1 :RRRRRRRR:X
FIELD1:CCCCCCCCCCCCCCCCCCCC:GROUP1 :AAAAAAAA:X
FIELD1:DDDDDDDDDDDDDDDDDDDD:GROUP2 :UUUUUUUU:
FIELD1:EEEEEEEEEEEEEEEEEEEE:GROUP2 :AAAAAAAA:
FIELD1:FFFFFFFFFFFFFFFFFFFF:GROUP2 :RRRRRRRR:
FIELD2:GGGGGGGGGGGGGGGGGGGG:GROUP3 :RRRRRRRR:Y
FIELD2:HHHHHHHHHHHHHHHHHHHH:GROUP3 :RRRRRRRR:Y
FIELD3:IIIIIIIIIIIIIIIIIIII:GROUP4 :RRRRRRRR:
FIELD3:JJJJJJJJJJJJJJJJJJJJ:GROUP4 :UUUUUUUU:
|
Any suggestion or solution would be appreciated. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use KEEPBASE to keep the first record of each group. According to your example, that would keep these records:
Code: |
GROUP1 X
...
FIELD1:DDDDDDDDDDDDDDDDDDDD:GROUP2 :UUUUUUUU:
...
GROUP3 Y
...
FIELD3:IIIIIIIIIIIIIIIIIIII:GROUP4 :RRRRRRRR:
|
Now you can just use an appropriate OUTFIL OMIT to get rid of those first GROUP1 and GROUP3 records based on blanks in some position (e.g. 1-5). |
|
Back to top |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
KEEPBASE solved the primary problem, but I was still losing some records which turned out to be records that were not duplicates according to positions 29-36. I found an example on page 602 of the V1R8.0 DFSORT Application Programming Guide that suggested using KEEPNODUPS (with WITHALL and KEEPBASE) and now all records are accounted for.
Thank you for your help Frank and have a Happy Thanksgiving. Your assistance to this board is invaluable. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Right. You need KEEPNODUPS for nondups. I'm glad you figured it out.
Thanks for the kind words and I wish you a Happy Thanksgiving as well. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
do you mind posting the code.
Thanks
Gerry |
|
Back to top |
|
|
|