View previous topic :: View next topic |
Author |
Message |
shailesh Beginner
Joined: 30 Jun 2006 Posts: 3 Topics: 2
|
Posted: Wed Jul 05, 2006 1:37 pm Post subject: table handling |
|
|
I got an array(10) of names to be displayed.I got to check the duplicates
and needs to display error. does the below logic work.
Code: |
PERFORM VARYING WS-CNT FROM 1 BY 1 UNTIL WS-CNT > 10
ADD NUM-1 TO WS-CNT GIVING WS-CNT2
PERFORM VARYING WS-CNT1 FROM WS-CNT2 BY 1
UNTIL WS-CNT1 > 10
IF WS-ARRAY(WS-CNT1) = SPACES
CONTINUE
ELSE
IF WS-ARRAY(WS-CNT1) = WS-ARRAY(WS-CNT2)
IF WS-ARRAY(WS-CNT1) NOT = SPACES
DISPLAY 'DUPLICATE RECORD FOUND'
END-IF
END-IF
END-PERFORM
END-PERFORM
|
|
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Jul 05, 2006 2:16 pm Post subject: |
|
|
shailesh,
You can run a test for yourself. Any way why do you think checking for Not equal to spaces will give you the duplicates? Your logic will NOT work
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|