title: How to parse XML file using Progress 4GL language?
body: <p><a href="https://i.stack.imgur.com/qlqsg.png" rel="nofollow noreferrer">See original XML</a></p>
  
  <p>i need to parse the XML after compare the previous row.Please take a look attached picture </p>
  
  <p>Below are my progress 4GL query for parsing XML</p>
  
  <pre><code>DEFINE INPUT PARAMETER ipc_fileName AS CHARACTER.
  
  DEFINE VARIABLE cSegmentName AS CHARACTER   NO-UNDO.
  DEFINE VARIABLE i AS INTEGER NO-UNDO.
  DEFINE VARIABLE i661 AS INTEGER NO-UNDO.
  DEFINE VARIABLE cInputData AS CHARACTER NO-UNDO.
  DEFINE VARIABLE lv_c_Customer_Number AS INTEGER NO-UNDO.
  
  INPUT FROM VALUE(ipc_FileName).
   IF cInputData = "" THEN NEXT.
      cSegmenTNAME = SUBSTRING(cInputData,1,3).     
  
  CASE cSegmenTNAME :
          WHEN "661" THEN DO:
                   i = i + 1.
              IF LENGTH(cInputData) = 128 THEN DO:
                  ASSIGN
                  i661                 = i
                  lv_c_Customer_Number = SUBSTRING(cInputData,6,9).
  END.
  </code></pre>
  
  <p>Like wise I can parse every row but my doubt is how to parse row 663 if previous row starts with 664.</p>
  
  <p>Any answers appreciated here.</p>