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 Under review
Workspace COBOL Compilers
Categories z/OS
Created by Guest
Created on Oct 23, 2024

Cobol Json Parse / Json Generate not reversible when working with Numeric Edited Fields

Hello,

I would like to mention again 2 old Cases from me (TS010652468 and TS016864176), because the problem happened again with another Developer.

Can you please check the last Case (TS016864176), where some discussion took place and IBM decided to implement partially some changes, but we would like to check if it's possible to change it.
"The last comment was to open an IBM Idea:

You are correct in that the parsing of " 000" into a field with PIC -9(3) will not be changed with the proposed changes. In regards to the generate/parse not being inverse operations, I can only reiterate that this is not the current design of COBOL's JSON handling. I don't know if an IDEA (formerly RFE - Request For Enhancement) has been entered for this behavior, but that would be the official channel to request a change in behavior: https://ideas.ibm.com/?interaction=raised"

---

Problem Description:

It is about the results when generating and parsing fields with Numeric Edit Fields (for example PIC -9).

Using the phrase from the Developer to explain:
We have a field in a Copybook that is declared as PIC -9(3).

With this field format, JSON GENERATE and JSON PARSE do not work symmetrically / not reversible.

JSON GENERATE writes the base value 0 as the string " 000".
JSON PARSE, however, expects a numerical value in return. (0 instead of " 000" works.)

We understand that a numeric edit field is a kind of Alphanumeric, but when parsing it should at least recognize and convert it correctly.
In the last CASE was told that it "works as designed".
Fine, but in case we convert Numeric Edited Fields it requires some workarounds.
We have already identified 2 Workaround:
1) Using Cobol Function NUMVAL to convert the Numeric Edited Field before the Json Generate - so it will generate correctly numeric - but we always need to know the content of each field, and a special check in case the field is NULL. The olf fashioned DEEDIT.
2) Replace the PIC -9(3) by PIC S9(3) SIGN LEADING SEPARATE in Copybook. So we have the sign separated and can be converted correctly. Also fine, but it requires changing a lot of possible copybooks.

So, is it really working as designed ? Numeric Edited fields should be considered an exception and be checked every time ? Or is it an error on JSON Generate or JSON Parse ?

Kind Regards,
Eduardo Carrara
R+V Versicherung
eduardo.carrara@ruv.de

Idea priority Low
  • Admin
    Basil Kanneth
    Reply
    |
    Nov 19, 2024

    This idea is being investigated further.

  • Guest
    Reply
    |
    Oct 24, 2024

    Ups. "Works as designed" when PARSE and GENERATE are not reversible? Sorry, that it not my understanding of a correct design. That is not worth an IDEA, that is a bug!