I have a requirement in which I have to load the data from a file into an array. The process is to read the second file and search for the data in the loaded array.
The data is sorted and I am using the first index for the Search all function. The code looks like below.
SEARCH ALL TABLE-ENTRIES
WHEN OFFICE(T-INDX) EQUAL TO WS-OFFICE AND
ACCTNO(T-INDX) EQUAL TO WS-ACCTNO AND
SECNO(T-INDX) EQUAL TO WS-SECNO
DISPLAY 'INSIDE THE SEARCH'
Here if I use search instead of search all the code is working fine and I am getting the expected results. Can anyone please point out what needs to be done to resolve this issue?
Note that the data in both the files are sorted by the Keys in the table definition and I am not at all getting any displays in the sysout. I am reading the second file to a layout exactly similar to OFFICE thru INTL-RATE
The definition for the table looks like
07 TABLE-ENTRIES OCCURS 20000 TIMES
ASCENDING KEY IS OFFICE
ASCENDING KEY IS ACCTNO
ASCENDING KEY IS SECNO
INDEXED BY T-INDX.
10 OFFICE PIC S9(4) COMP-3.
10 ACCTNO PIC S9(8) COMP-3.
10 SECNO PIC X(9).
10 INTL-RATE PIC S9(7)V99 COMP-3.
Thanks a lot Dick. That solved my issue entirely. I was struggling with this one for the last 24 hrs and I even coded a small pgm to test the functionality. I have made all the changes that you have told me and the pgm is just working fine….