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).
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:
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 an idea.
Get feedback from the IBM team and other customers to refine your idea.
Follow the idea through the IBM Ideas process.
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.
This RFE has been delivered in the following
COBOL V6.3 November 2020 PTF: APAR PH30975 https://www.ibm.com/support/pages/apar/PH30975
COBOL V6.2 December 2020 PTF: APAR PH32356 31172 https://www.ibm.com/support/pages/apar/PH32356
COBOL November 2020 Runtime PTF: APAR 31172 https://www.ibm.com/support/pages/apar/PH31172
Is it possible also that to SUPPRESS ALL-FIELDS ALLSPACE ZERO?
Instead of coding for each field that might be optional, consider all fields are optional and should be omitted if "empty". This is the industry standard for JSON used in API's. So we should be able to easily support it in our code without having to duplicate the entire structure in the GENERATE statement.
It would be necessary to consider Array/Occurs and object as well in this RFE.
If we have this copy cobol :
01 copyJSon
05 amount pic 9(5).
05 myObject.
10 thing1 pic X(10).
05 myArray occurs 10.
10 thingA pic X(10).
10 thingB pic X(10).
I move all space to copyJSon.
I only supply data for amount, myArray(1) and myArray(2).
We would like that the generated outcome be like this :
{
"amount": 500,
"myArray": [
{"thingA":"Hello","thingB":"World"},
{"thingA":"Details","thingB":"Comments"}
}
Suggestions :
JSON GENERATE buffer FROM copyJSon
NAME OF copyJSon is OMITTED
SUPPRESS myObject ALLSPACE
SUPPRESS myArray ALLSPACE
END-JSON
We are implementing more and more RESTful-API‘s to enable different customer oriented applications accessing our mainframe-based busines functions. The API-consumers expect the optional attributes not to be included in the server responce if they don't have sensible content. Therefore we are forced to eliminate the „empty“ items by means of string manipulation functions after the generating of JSON-Output. This post processing is more complex because of UTF-8 encoding and lowes noticeably the advatage of using of JSON GENERATE.
Furthemore, there are some interfaces to software products in our company that use boolean data type, so we need boolean support too.
This features would essentially simplify the development of RESTful-API's in a mainframe COBOL environment and reduce costs and time Need.
Sorry, forgot to mention the missing Boolean support. This was part of our RfE 142045, which was closed as a duplicate of this.
ALLSPACE and ZERO seems to be very helpful. But LOWVALUE might also be a good option. Can you please check, if this is also possible?
We have accepted this RFE and will be updated further once put into plan. Thanks.
Thank you for your recent response. We are reviewing it and will respond shortly.
Hi,
Having ALLSPACE and ZERO is sufficient and would be very helpful for us.
For the NULLIFY keyword, it was just a mere suggestion and it might actually be confusing :
- it would have meant "don't add this key/value in my generate JSON if its value is 0 or space or Low-Value"
- it is not as clear as SUPPRESS myJsonAlphaZoneBecauseIts ALLSPACES or SUPPRESS myJsonNumericZoneBecauseIts ZERO
Thanks,
Hi,
Out of the cases you mentioned, we could possibly do the ALLSPACE and ZERO scenarios.
May we know if this is sufficient?
Also can you please clarify what you mean by "have a new keyword (NULLIFY e.g.)" ?
Thanks.