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.
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';
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