midrange.com code scratchpad
Name:
XML-INTO processing
Scriptlanguage:
Plain Text
Tabwidth:
4
Date:
07/11/2008 03:29:21 pm
IP:
Logged
Description:
For some reason, on the transaction.datetime and transaction.quantity are filled when loadCurrentRow fires. See http://code.midrange.com/e94c59dafe.html for the XML file in question.
Code:
  1.      D options...
  2.      D                 S            100A
  3.      D commAreaDef...
  4.      D                 S              1A
  5.      D transactionDefinition...
  6.      D                 DS                  based(TEMPLATE_ONLY)
  7.      D                                      qualified
  8.      D  customerCode...
  9.      D                                6A
  10.      D  datetime...
  11.      D                               19A
  12.      D  docketNumber...
  13.      D                               15A
  14.      D  quantity...
  15.      D                               12P 4
  16.      D  productType...
  17.      D                               50A
  18.      D  unitNumber...
  19.      D                               20A
  20.  
  21.      D loadCurrentRow  PR            10I 0
  22.      D  commArea                           LIKE(commAreaDef)
  23.      D  transaction                          LIKEDS(transactionDefinition)
  24.      D                                     DIM(1)
  25.      D                                     const
  26.      D  elementsInCount...
  27.      D                               10I 0 VALUE
  28.  
  29.       /free
  30.          options = 'doc=file path=details/transaction allowextra=yes +
  31.                         allowmissing=yes';
  32.          xml-into %handler(loadCurrentRow : commAreaDef)
  33.                       %xml('/tmp/fuel/fuelConsumption.xml' : options);
  34.  
  35.        /end-free
  36.  
  37.  
  38.      P loadCurrentRow  B
  39.      D loadCurrentRow  PI            10I 0
  40.      D  commArea                           LIKE(commAreaDef)
  41.      D  transaction                          LIKEDS(transactionDefinition)
  42.      D                                           DIM(1)
  43.      D                                           const
  44.      D  elementsInCount...
  45.      D                               10I 0 VALUE
  46.  
  47.      P loadCurrentRow  E
© 2004-2019 by midrange.com generated in 0.008s valid xhtml & css