Skip to Main Content
IBM Power Ideas Portal


This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. 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
Workspace IBM i
Categories Languages - RPG
Created by Guest
Created on Apr 21, 2017

XML-INTO: Add new option to clear DS before loading

Add an option to XML-INTO that clears the DS before parsing the XML data into the DS. This option should work similarly to EVAL and other "assignment-type" functions.
Data Structures are typically used to temporarily store XML data prior to taking another action (writing to a file, calling another procedure, etc.). This action is often repeated/cylcled many times during execution of the program or procedure.
Why would any operation choose to leave data "remnants" in a program variable?

Example:
XML-INTO ItemsDS %XML(xmlfile: 'doc=file case-any clear=yes')


Use Case:

Amazon Marketplace Web Services (MWS) Order retrieval process uses XML payload

The API structure dictates that the client reqeusts the following:

1. ListOrders: Get a list of orders (XML-INTO loads response into Order DS)
2. ListOrderItems: For each order you must then reqeust a list of line items (read Order DS, ListOrderItems, XML-INTO loads response into Item DS)
3. At this point the DS data is written to Order Header and Order Detail tables
4. Upon reading the next order in Order DS and requesting the line items for that order, Item DS should be CLEARED prior to XML-INTO parsing the response into Item DS. Otherwise, Item DS still contains data elements from the previous order.


Idea priority Medium
  • Guest
    Reply
    |
    May 30, 2017

    IBM does not intend to provide a solution to this request at this time, so it is being closed. XML-INTO is more like EVAL-CORR than the other assignment operations. (EVAL-CORR doesn't affect subfields that aren't in the source data structure.) Use the CLEAR opcode to clear the data structure before XML-INTO.

  • Guest
    Reply
    |
    Apr 25, 2017

    With %HANDLER, the data structure to be passed to the handler is cleared before the parsing is done. So the issue only applies to the non-%HANDLER case.

  • Guest
    Reply
    |
    Apr 25, 2017

    As stated the requirement can be met simply by coding appropriate INZ(s) on the DS. Not to mention avoiding using allowmissing=yes and adding appropriate countprefix options to deal with situations like this.

    I'm having trouble in seeing the value. The only time this is potentially an issue is when using %Handler because there you cannot code an INZ. But even then counts should handle it.