---
title: "COBOL GT Spaces and NE Spaces"
description: "Cobol best practices is one of the important area to focus both by Junior and Senior developers. It not only improves performance and is very easy to manage or maintain COBOL programs in future."
url: https://srinimf.com/2016/06/16/cobol-gt-spaces-and-ne-spaces/
date: 2016-06-16
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2016/06/pexels-photo-7129211.jpeg?fit=1880%2C1253&ssl=1
categories: ["COBOL"]
tags: ["Best way to give COBOL GT Spaces", "Good coding idea to give COBOL NE Low-values"]
type: post
lang: en
---

# COBOL GT Spaces and NE Spaces

![COBOL Good Coding](https://i0.wp.com/srinimf.com/wp-content/uploads/2016/06/cobol-good-coding-e1466048048741.png?resize=294%2C414&ssl=1)
COBOL Good Coding

Good COBOL coding practice take you to next level in your career. In COBOL greater than spaces and not equal to spaces is one interesting point. Recently in our project there was a discussion, which is the best method to follow.

## COBOL Good Coding Examples

**Let me take an example,**

IF X NE [SPACES and LOW](https://srinimf.com/2021/09/05/how-to-check-comp-variable-for-spaces-and-low-values/)-VALUES

THEN

do whatever…

END-IF

In the above example, used not equal to for both spaces and low-values. The way using negative condition is difficult to understand by programmers. Also, you are giving two conditions by using and -this is also not good practice of [COBOL program](https://srinimf.com/2015/09/21/java-for-mainframe-coders-cobol-subroutine-vs-java-class/)ming.

Related[COBOL Low Values Vs High Values](https://srinimf.com/2013/08/18/cobol-low-values-and-high-values/)

**Revised example is:**

IF X GT SPACES or X NE LOW-VALUES

Related[COBOL: Move, Group Move, Low-values, High-values](https://srinimf.com/2010/04/04/cobol-stuff/)

THEN

do whatever…

END-IF

The above revised coding example does make sense, and easy to understand by other programmers. And, there is no confusion.

Related Posts

- [COBOL Low Values Vs High Values](https://srinimf.com/2013/08/18/cobol-low-values-and-high-values/)DateAugust 18, 2013
- [COBOL: Move, Group Move, Low-values, High-values](https://srinimf.com/2010/04/04/cobol-stuff/)DateApril 4, 2010
- [These COBOL File Status Codes Asked in Many Mainframe Interviews](https://srinimf.com/2015/06/26/these-cobol-file-status-codes-asked-in-many-mainframe-interviews/)DateJune 26, 2015

Get new content delivered directly [to your](https://srinimf.com/2014/03/25/db2-v10-daily-tips-email/) inbox.

Type your email…

Sign up

### 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%2F06%2F16%2Fcobol-gt-spaces-and-ne-spaces%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2016%2F06%2Fpexels-photo-7129211.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=COBOL%20GT%20Spaces%20and%20NE%20Spaces)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2016/06/16/cobol-gt-spaces-and-ne-spaces/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2016/06/16/cobol-gt-spaces-and-ne-spaces/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2016/06/16/cobol-gt-spaces-and-ne-spaces/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2016/06/16/cobol-gt-spaces-and-ne-spaces/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20COBOL%20GT%20Spaces%20and%20NE%20Spaces&body=https%3A%2F%2Fsrinimf.com%2F2016%2F06%2F16%2Fcobol-gt-spaces-and-ne-spaces%2F&share=email)
-

### Like this:

Like Loading…
