IBM Support

How to output multiple XML documents form a single CSV file containing multiple purchase orders.

Question & Answer


Question

I am trying to process a single ADF Comma Separated Value (CSV) file containing multiple purchase orders. Can WDI generate multiple XML outputs based on a single CSV file which has only one Line item record type?

Answer

Since there is only one record defined in the ADF, which has a record ID has a value of "ZZ", WDI does not have anything to key off of to cause a break to a new output XML document. Thus implying that there is no Beginning or Ending record within the input ADF to tell WDI when to break into a new output XML document. Either add a new record with a unique record ID to the input file indicating where the "Header" for each PO begins or use double Data Transformation. The first DT map could transform the original CSV file into another CSV with a new "Header" record added appropriately. In this case, a change in PO number is what controls the creation of the new Header record. In the source-based map snippet below, the source data format ORD record is mapped to a target data format loop containing both the new Header record (ORD_HEADER) and the Line item record (ORD_LINE), The "If" statement with String Compare to the last PO number controls the creation of a unique Header record with record ID "HH", as interleaved with the existing Line item records with its own unique record ID of "ZZ".


[{"Product":{"code":"SSFKTZ","label":"WebSphere Data Interchange"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"WDI 3.3 MP","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF033","label":"Windows"},{"code":"PF035","label":"z\/OS"}],"Version":"3.3","Edition":"All Editions","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
01 August 2018

UID

swg21979241