---
title: "5 Top Limitations of COBOL SEARCH ALL"
description: "The condition following the word WHEN can test only for equality: Valid: WHEN T-CUSTOMER-NO (X1) = CUST-NO-IN. Invalid: WHEN T-WEIGHT-MAX (X1) < WEIGHT-MAILED. https://srinimf.com/2016/01/06/best-exam..."
url: https://srinimf.com/2016/01/07/5-top-limitations-of-cobol-search-all/
date: 2016-01-07
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2016/01/pexels-photo-5597694.jpeg?fit=1880%2C1296&ssl=1
categories: ["COBOL"]
tags: ["Search All in COBOL"]
type: post
lang: en
---

# 5 Top Limitations of COBOL SEARCH ALL

The condition following the word WHEN can test only for equality:

**Valid: **WHEN T-CUSTOMER-NO (X1) = CUST-NO-IN

**Invalid: **WHEN T-WEIGHT-MAX (X1) < WEIGHT-MAILED

Related[Best Example for COBOL SEARCH and WHEN Condition](https://srinimf.com/2016/01/06/best-example-for-cobol-search-and-when-condition/)

## If the condition following the word WHEN is a compound conditional:

- a. Each part of the conditional can only consist of a relational test that involves an equal condition.
- b. The only compound condition permitted is with ANDs, not ORs.Valid: WHEN S-AMT (X1) = AMT1 AND TAX-AMT (X1) = AMT2Invalid: WHEN SALES-AMT (X1) = AMT3 OR AMT4 = AMT5
- Only one WHEN clause can be used with a [SEARCH ALL](https://srinimf.com/2015/10/02/cobol-search-and-search-all-differences/). The VARYING option may not be used with the SEARCH ALL.

Related[How to Create VB file Using Varying Clause in COBOL](https://srinimf.com/2010/09/02/cobol-variable-recordvb-files/)

## The OCCURS item and its index, which define the table argument, must appear to the left of the equal sign.

Valid: WHEN S-AMT (X1) = AMT1…
Invalid: WHEN AMT1 = S-AMT (X1)…

Related Posts

- [COBOL SEARCH: How to Use IF Logic Explained](https://srinimf.com/2018/05/25/cobol-real-time-example-to-write-if-logic-in-search-statement/)DateMay 25, 2018
- [Best Example for COBOL SEARCH and WHEN Condition](https://srinimf.com/2016/01/06/best-example-for-cobol-search-and-when-condition/)DateJanuary 6, 2016
- [COBOL ‘EVALUATE ALSO’ Best Examples](https://srinimf.com/2020/04/28/evaluate-also-example/)DateApril 28, 2020

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2016%2F01%2F07%2F5-top-limitations-of-cobol-search-all%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2016%2F01%2Fpexels-photo-5597694.jpeg%3Ffit%3D1200%252C827%26ssl%3D1&description=5%20Top%20Limitations%20of%20COBOL%20SEARCH%20ALL)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2016/01/07/5-top-limitations-of-cobol-search-all/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2016/01/07/5-top-limitations-of-cobol-search-all/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2016/01/07/5-top-limitations-of-cobol-search-all/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2016/01/07/5-top-limitations-of-cobol-search-all/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%205%20Top%20Limitations%20of%20COBOL%20SEARCH%20ALL&body=https%3A%2F%2Fsrinimf.com%2F2016%2F01%2F07%2F5-top-limitations-of-cobol-search-all%2F&share=email)
-

### Like this:

Like Loading…
