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
 
Search All Error, not a key of the table being searched

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

New User


Joined: 18 Jun 2008
Posts: 54
Location: Colombo

PostPosted: Tue Jun 26, 2012 6:24 pm    Post subject: Search All Error, not a key of the table being searched
Reply with quote

Hi,

I am getting an error when using SEARCH ALL. Please see below and help me. Thanks.

WORKING-STORAGE SECTION.

01 WS-NAME PIC X(5).

01 INT-TABLE.
05 BUMKT OCCURS 10 TIMES ASCENDING KEY DATA1 INDEXED BY WS-SUB1.
10 DATA1.
15 NAME PIC X(5).
15 LOCATION PIC X(5).


PROCEDURE DIVISION.

SEARCH ALL BUMKT
AT END
DISPLAY 'MATCH NOT FOUND'
WHEN NAME = WS-NAME
DISPLAY LOCATION
END-SEARCH.


Error Message:


The left side operand, "NAME (ALPHANUMERIC)", of a "WHEN"
phrase of a "SEARCH ALL" statement was not a key of the table being
searched. The statement was discarded.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Tue Jun 26, 2012 6:26 pm    Post subject:
Reply with quote

The message tells you exactly what is wrong. You defined DATA1 as your key -- so your SEARCH ALL must use DATA1, not NAME, for your WHEN clause. SEARCH ALL does not support partial key searches.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Jun 26, 2012 6:34 pm    Post subject: Reply to: Search All Error
Reply with quote

Define some good datanames, please. I'm surprised "NAME" isn't already RESERVED, but it could be someday. Surely the contents of your data are not the only thing worthy of the word NAME in the entire world, so why not describe them a bit better and help out the next person who looks at your program (and you in a week's time) so that they know what "NAME" is.
Back to top
View user's profile Send private message
cvijay784
Warnings : 1

New User


Joined: 18 Jun 2008
Posts: 54
Location: Colombo

PostPosted: Tue Jun 26, 2012 6:34 pm    Post subject: Reply to: Search All Error
Reply with quote

Thanks for your reply. Can i have more than 1 field as table key?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Jun 26, 2012 6:35 pm    Post subject: Reply to: Search All Error
Reply with quote

Isn't it easy enough to look in the manual? Toss in a compile yourself?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Tue Jun 26, 2012 6:46 pm    Post subject:
Reply with quote

Your question is not clear as worded.

If you are asking whether more than one variable can be specified as the table keys, the answer is yes -- but you must load the table in the correct sequence based on all the keys.

If you are asking whether the ASCENDING (DESCENDING) KEY IS phrase can reference a group variable, the answer is a qualified yes. The manual indicates that a group variable used as a table key cannot have an OCCURS clause nor can it contain any OCCURS DEPENDING ON on any subordinate level.
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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm

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