Midrange News for the IBM i Community


Posted by: George Fuste
IBM i developer
Jacksonville, FL
XML-into
has no ratings.
Published: 14 Mar 2019
Revised: 15 Mar 2019 - 122 days ago
Last viewed on: 10 Jul 2019 (76 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

XML-into Published by: George Fuste on 14 Mar 2019 view comments(1)

Cannot get count in field "numGTIN"

 

Using countprefix in XML options and have field numGTIN defined to store it.  Am I doing something wrong in my DS?

 

D OrderRecord DS Qualified Inz
D OrderHeader LikeDS(OrderHdr_T)
D OrderDetail LikeDS(OrderDtl_T) Dim(5000)
D numGTIN 10i 0

D OrderHdr_T DS Template
D StoreId 6 0
D StoreName 30
D UniqueOrderID 8 0
D DateCreated 20
D SupplierID 4 0
D SupplierName 30
D OrderTotal 7 2
D MessageToSupp1ier...
D 50

D PONumber 10 0
D AccountNumber 6 0
D OrderSource 4 0
D OrderStatus 2 0
D ValidateItemData...
D 1

D OrderDtl_T DS Qualified
D Based(Template)
D GTIN 14 0
D SupplierSKU 8 0
D Quantity 6 0
D Cost 7 2
D Front 1
D Back 1
D ItemDescription...
D 35
D PagePartition 1
D OrderedBy 15
D CasePack 5 0

 

XML-Into OrderRecord
%xml(%Trim(FileLocn): Options);

 

Options = 'case=any doc=file AllowMissing=yes AllowExtra=yes +
countprefix=num';

 

 

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: XML-into
Posted: 4 months 2 days 14 hours 15 minutes ago
Edited: Fri, 15 Mar, 2019 at 07:47:27 (122 days ago)

The COUNTPREFIX is an identifier that is used to search the sub field list of the data structure for a field to insert the count. The suffix of that field must equate to another field in the data structure. In your example, the sub field name should be numOrderDetail