Hi Forum,
I have come across a strange behavior in my code. Where in I was using SEARCH ALL to search my table which an was not working.
On the other hand when I used SEARCH then it worked just fine.
Here is my table definition.
Can anyone tell me why SEARCH worked while SEARCH ALL didn't??
01 WS-WALL-TABLE.
05 WS-WALL-TBL OCCURS 100 TIMES
ASCENDING KEY IS WS-DC-CODE
WS-WALL-IND
INDEXED BY TBL-INDEX2.
10 WS-DC-CODE PIC X(04).
10 WS-WALL-IND PIC X(01).
SET TBL-INDEX2 TO 1
MOVE 'N' TO FLAG
MOVE EHDS-INPUT-DC-NO TO OL-DC-NO.
SEARCH WS-WALL-TBL
AT END MOVE 'N' TO FLAG
WHEN WS-DC-CODE (TBL-INDEX2) = DC-NO
AND WS-WALL-IND (TBL-INDEX2) = 'Y'
MOVE 'Y' TO FLAG
END-SEARCH