I wonder if someone can help. I have the following arrays:
05 WS-TABLE-1 OCCURS 20 TIMES.
10 WS-T1-ID.
15 WS-T1-CAR-CODE PIC X(03).
15 WS-T1-SER-NUM PIC X(04).
15 WS-T1-DEL-DATE PIC X(06).
10 WS-T1-DPT-IND PIC X(01).
10 WS-T1-EQP-CAT PIC X(01).
10 WS-T1-A-MIN PIC 9(04).
10 WS-T1-DUP-FL PIC X(01).
05 WS-TABLE-2 OCCURS 20 TIMES.
10 WS-T2-ID.
15 WS-T2-CAR-CODE PIC X(03).
15 WS-T2-SER-NUM PIC X(04).
15 WS-T2-DEL-DATE PIC X(06).
10 WS-T2-DPT-IND PIC X(01).
10 WS-T2-EQP-CAT PIC X(01).
10 WS-T2-A-MIN PIC 9(04).
10 WS-T2-DUP-FL PIC X(01).
10 WS-T1-ID.
15 WS-T1-CAR-CODE PIC X(03).
15 WS-T1-SER-NUM PIC X(04).
15 WS-T1-DEL-DATE PIC X(06).
10 WS-T1-DPT-IND PIC X(01).
10 WS-T1-EQP-CAT PIC X(01).
10 WS-T1-A-MIN PIC 9(04).
10 WS-T1-DUP-FL PIC X(01).
05 WS-TABLE-2 OCCURS 20 TIMES.
10 WS-T2-ID.
15 WS-T2-CAR-CODE PIC X(03).
15 WS-T2-SER-NUM PIC X(04).
15 WS-T2-DEL-DATE PIC X(06).
10 WS-T2-DPT-IND PIC X(01).
10 WS-T2-EQP-CAT PIC X(01).
10 WS-T2-A-MIN PIC 9(04).
10 WS-T2-DUP-FL PIC X(01).
Actually, the contents of WS-TABLE-2 is exactly the same as WS-TABLE-1. I just created it in case I could use it to match with WS-TABLE-1.
Anyways, the thing is, I need to produce an array looking like WS-TABLE-1 containing only unique occurrences and where WS-T1-DUP-FL (subscript) = "Y" if a duplicate was found. Here's what I mean:
Input:
AAA1111081203NA0010
BBB1111081203NA0010
AAA1111081203NA0010
CCC1111081203NA0010
EEE1111081203NA0010
DDD1111081203NA0010
EEE1111081203NA0010
PPP1111081203NA0010
Output:
AAA1111081203NA0010Y
BBB1111081203NA0010
CCC1111081203NA0010
EEE1111081203NA0010Y
DDD1111081203NA0010
PPP1111081203NA0010
AAA1111081203NA0010
BBB1111081203NA0010
AAA1111081203NA0010
CCC1111081203NA0010
EEE1111081203NA0010
DDD1111081203NA0010
EEE1111081203NA0010
PPP1111081203NA0010
Output:
AAA1111081203NA0010Y
BBB1111081203NA0010
CCC1111081203NA0010
EEE1111081203NA0010Y
DDD1111081203NA0010
PPP1111081203NA0010
Thanks for your time.
Kind regards,
pmerc