Thread: COBOL

SEARCH vs SEARCH ALL when the key appears twice

Started by Jordan • user2 replies120 viewsLast activity 1 week ago
Post #1
1 votes
Jordan
Reputation
12
Posts: 32
Joined: May 2, 2026, 11:10 AM
Posted: Aug 5, 2026, 11:05 AM

Table can have duplicate keys. If I SEARCH or SEARCH ALL, do I get every match or just one?

Post #2
0 votes
Marty
Reputation
412
Posts: 58
Joined: Aug 12, 2024, 9:14 AM
Posted: Aug 5, 2026, 12:05 PM

One. SEARCH finds the first from the current index. Bump the index and SEARCH again if you want the next.

SEARCH ALL finds one of them. Which one is undefined. Do not use it if you need all duplicates.

You must be signed in to reply to this thread