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 Future consideration
Created by Guest
Created on Oct 8, 2019

Add an isNumeric() test to record classes

There currently is no straightformat way for generated record classes to check whether a byte pattern contains valid numeric data (in the sense of the COBOL "IS NUMERIC" test). However, this is often needed:

Since COBOL does not really have the notion of an SQL NULL or a Java null, they need other ways to indicate absence of a value. Either a separate flag, or an out-of-band value such as all blanks, or all low-values. For numeric data (if in zoned or external format), that could be a byte pattern that is not in zoned or external format -- that is, a byte pattern for which the COBOL "IS NUMERIC" test would answer false.

So, it would be very useful to have an isNumeric() method on the XxxAccessor interfaces that have the same semantics as IS NUMERIC in COBOL.

This is not really a requirement to the Record Generator but more to the JZOS classes and the com.ibm.dataaccess classes.

What I would propose is the following:

Add a method with signature "boolean isNumeric()" to all "XxxAccessor" interfaces in package com.ibm.jzos.fields. That would be six interfaces (BigDecimalAccessor, BigIntegerAccessor, DoubleAccessor, FloatAccessor, IntAccessor, LongAccessor). Or if possible, add an intermediate "NumericAccessor" interface to the hierarchy which would have the isNumeric() method, and which the six numeric accessor interfaces would extend.

The XxxField implementation classes would then have to implement that isNumeric() method. In the case of "BinaryXxxField", it would trivially always return true since binary fields are alyways numeric by definition.

In the case of, e.g., ExternalDecimalAsBigDecimalField, the implementation would have to check whether the bytes at the buffer position really do represent a number in external decimal format with the respective sign representation. These implementation classes delegate most of the heavy lifting to class com.ibm.dataaccess.DecimalData, which in turn is part of the IBM JDK (I think).
For packed decimals, there is a private utility method, checkPackedDecimal_(), in class com.ibm.dataaccess.PackedDecimal, and that seems to be close to what would be needed. It would basically just need to be made public, and be used from the proposed isNumeric() methods.

Idea priority Medium
  • Guest
    Reply
    |
    Apr 28, 2020

    This requirement is understood and will be transferred to the IBM Java SDK team who own the com.ibm.jzos.fields package and have agreed to process this requirement. In the meantime it would be useful to raise a further RFE against the IBM Record Generator to request that it supports the COBOL IS NUMERIC test once we have the new function from the Java SDK

  • Guest
    Reply
    |
    Apr 28, 2020

    Due to processing by IBM, this request was reassigned to have the following updated attributes:
    Brand - Servers and Systems Software
    Product family - z Systems Software
    Product - JAVA
    Component - JAVA
    Operating system - IBM z/OS
    Source - None

    For recording keeping, the previous attributes were:
    Brand - Servers and Systems Software
    Product family - z Systems Software
    Product - IBM Record Generator for Java
    Component - IBM Record Generator for Java
    Operating system - z/OS
    Source - Client