Skip to Main Content
IBM Z Software


This portal is to open public enhancement requests against IBM Z Software products. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Not under consideration
Categories EGL Language
Created by Guest
Created on Jun 1, 2011

Support substrings with length zero in EGL

EGL supports the concept of substrings by means of the syntax: source[start:end], which returns the substring of source from position start to end, including both start and end position.

Currently, when end is less than start, a run-time exception is thrown, so the shortest substring that is currently supported has length one, which is when end == start.

This is true for all environments except RUI/JavaScript, where end is allowed to be less than start and an empty substring (i.e. with length zero) is returned when end == start - 1).

We request to extend this support for substrings with length zero, which is already available in the RUI/JavaScript environment, to all other environments.

Idea priority Medium
  • Guest
    Reply
    |
    Sep 14, 2015

    Due to processing by IBM, this request was reassigned to have the following updated attributes:
    Brand - Servers and Systems Software
    Product family - Programming Languages
    Product - Business Developer

    For recording keeping, the previous attributes were:
    Brand - Rational
    Product family - Design & development
    Product - Business Developer

  • Guest
    Reply
    |
    Dec 20, 2012

    The argument that a character variable always has a length is not relevant for this RFE. As already stated, string variables can be empty and have zero length. This RFE is about EGL substrings in general, regardless whether source or target is a string or char variable. The two types can be assigned to each other anyway and the type will be cast automatically.
    Currently, the runtime exception is thrown even when both source and target is a string variable. That makes no sense. When the target is a char variable and the result is shorter, it will be padded with blanks automatically, so that can be done even when the substring length is zero, in which case the target char variable will become all blanks.

    Of course the current restriction can be circumvented by coding a substring function, but that would have a much bigger performance impact than just an extra if statement in the generated COBOL code, which would only be needed when any of the substring indices is variable.
    Java and JavaScript already support zero length (sub)strings, so in those environments there should not be any performance impact.

  • Guest
    Reply
    |
    Jun 27, 2011

    This has been reviewed by development and the request is being rejected. For a Character variable, it will always have a length as there is no such thing in EGL as an empty character field. It may have a value of all blanks, but it still has its defined length. String datatypes can be empty and have zero length.

    As a potential workaround, it is felt that a function could be written when needed to check the lengths and return the desired values. Loose typing is available for CHARs or it could use Strings. The use of the .bytes function for a character field could also be used. For assistance on a possible workaround, please work with your contact in EGL development.