Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Having a problem with my search all in cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Rema

New User


Joined: 13 May 2008
Posts: 1
Location: India

PostPosted: Wed May 14, 2008 6:25 pm    Post subject: Having a problem with my search all in cobol
Reply with quote

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
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed May 14, 2008 6:57 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed May 14, 2008 9:05 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us