View previous topic :: View next topic
|
Author |
Message |
Rema
New User
Joined: 13 May 2008 Posts: 1 Location: India
|
|
|
|
I am having a problem with my search all in cobol. The same is working fine when using a search.
My array definition is like this.
Code: |
01 WA-DB2-ARRAY.
03 WA-DB2-REC OCCURS 638678 TIMES
DEPENDING ON WA-DB2-ACCT-CNT
ASCENDING WA-DB2-EXPAND-ACCT-NBR
INDEXED BY WA-DB2-INDEX.
05 WA-DB2-EXPAND-ACCT-NBR.
10 WA-DB2-BNK-LOC PIC X(01) VALUE SPACES.
10 WA-DB2-BNK-SYS PIC X(01) VALUE SPACES.
10 WA-DB2-ACCT-NBR PIC X(08) VALUE SPACES.
|
The data is loaded as below through a Fetch from a Cursor. The fetch is performed varying the wa-db2-index variable.
Code: |
ADD 1 TO WA-DB2-ACCT-CNT
MOVE REL-MCARL-ID TO
WA-DB2-RELT-ID (WA-DB2-INDEX)
IF ACT-MCA-NO(1:2) = 'LM' OR 'MM' OR 'SM'
MOVE ACT-MCA-NO TO
WA-DB2-EXPAND-ACCT-NBR (WA-DB2-INDEX)
ELSE
MOVE ACT-MCA-NO TO
WA-DB2-ACCT-NBR (WA-DB2-INDEX)
MOVE SPACES TO
WA-DB2-BNK-LOC (WA-DB2-INDEX)
WA-DB2-BNK-SYS (WA-DB2-INDEX)
END-IF.
|
There is an input array in the program. I need to search for the account number in the input array in this db2 array. The SEARCH is working fine. But the SEARCH all is not working.
Code: |
SET WA-DB2-INDEX TO 1.
SEARCH ALL WA-DB2-REC --> not working
SEARCH WA-DB2-REC VARYING WA-DB2-INDEX --> working
AT END
MOVE 'ACCOUNT NOT FOUND IN DB2 ARRAY'
TO WA-R-ERROR-MSG
DISPLAY 'ACCOUNT NOT FOUND IN DB2 ARRAY'
DISPLAY 'WA-DB2-EXPAND-ACCT-NBR (WA-DB2-INDEX):'
WA-DB2-EXPAND-ACCT-NBR (WA-DB2-INDEX)
DISPLAY 'WA-INP-EXPAND-ACCT-NBR :'
WA-INP-EXPAND-ACCT-NBR (WA-INDEX)
PERFORM 40000-WRITE-REPORT THRU 40000-EXIT
WHEN WA-DB2-EXPAND-ACCT-NBR (WA-DB2-INDEX) =
WA-INP-EXPAND-ACCT-NBR (WA-INDEX)
PERFORM 35000-COMPARE-FIELDS THRU 35000-EXIT
END-SEARCH.
|
Note: My CURSOR will around 700,000 records and put in the array. The array size is 2,000,000.
Q1) Why is it that Search is working and search all is not working?
Q2) When I use a small number of records in the cursor, it is working fine. Say like 20 records i tested with search all it is working fine.
Q3) Is there any size limitation with the search all array?
Thanks,
Rema |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Rema wrote: |
Q1) Why is it that Search is working and search all is not working? |
Probably because your array's key is not in sequence.
Quote: |
Q2) When I use a small number of records in the cursor, it is working fine. Say like 20 records i tested with search all it is working fine. |
Probably because those 20 keys are in sequence.
Quote: |
Q3) Is there any size limitation with the search all array? |
Check Appendix B. Compiler limits. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Rema and welcome to the forums,
Why do you need to load that many table entries? What does your process actually do (beyond search a table that may not even be needed)? Are you trying to compare an external file to the table? |
|
Back to top |
|
|
|