Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 9405

DFSORT/ICETOOL :: Finding repetead surnames in differents colmuns

$
0
0
Author: blackjack202
Subject: Finding repetead surnames in differents colmuns
Posted: Tue Jun 07, 2016 7:42 pm (GMT 5.5)

Hi there,

I have the following problem. I will try to explain it, the idea is to delete those records who have relatives in the same oficce. We know that if the surname is repeat it, we have to remove those records. But the big problem, at least for me, is how can i manage when the surname1 is also in the surname 2 or the other way around?

For example:

Format INPUT ==> OFIC (1 CHAR) - ACC.NUM( 1 CHAR) - SURNAME1 (50 CHAR) - SURNAME2 (50 CHAR) - NAME (50 CHAR)
INPUT:
Code:

OFIC.   ACC.NUM      SURNAME1    SURNAME2   NAME
1          1         ARIZONA     ROCAFORT   JUAN
           1         ROCAFORT    MARTINEZ   ANNA
           2         SEVILLA     RODRIGUEZ  ERNESTO
           3         ARIZONA     MARTINEZ   JULIAN           
2          1         RODRIGUEZ   MARTINEZ   FEDERICO
           2         RODRIGUEZ   MARTINEZ   FAUSTO
           3         AMARAL      ZAPATA     GILDA
           3         BAGGINS     SHIRE      ROBERT
           4         ZAPATA      TANK       JOHN
3          1         MARTIN      MERIADOC   MARCOS
           1         CRYSTAL     EDURNE     VERONICA

OUTPUT:

Code:
OFIC.   ACC.NUM      SURNAME1    SURNAME2   NAME
1          2         SEVILLA     RODRIGUEZ  ERNESTO
2          3         BAGGINS     SHIRE      ROBERT
3          1         MARTIN      MERIADOC   MARCOS
           1         CRYSTAL     EDURNE     VERONICA

The most complicated case, as you can see, is the case of the OFIC = 2 ACC. NUM = 3 and 4, the SURNAME ZAPATA is in column SURNAME1 and SURNAME2. It is possible to do this with DFSORT or any other? am open to any suggestion. For me will be easy to do it with an internal table in COBOL, but is not possible for me to reach this solution for burocratic stuff here at work.

Thanks you so much, for your support! icon_biggrin.gif

PD: Yes, it is my first time, in the fórum icon_redface.gif
_________________
Mario F. P.


Viewing all articles
Browse latest Browse all 9405

Trending Articles