Visual Cobol 2.2 Linux .cbl file
Getting error when executing XML parse.
This program works in Vce 2.2 for Windows.
What is the reason for error in Linux?
The source that you provided is not complete and contains errors.
I created a test program based on what I thought your program was doing and it runs without error under both VC 2.2 Windows and Linux. We tested with RHEL Server release 5.3. The following is what we tested with: Does this fail for you?
identification division. program-id. Program1. environment division. configuration section. data division. working-storage section. 01 xml-data. 05 start-of-data. 10 field1 pic x(10). 10 field2 pic x(20). 10 field3 pic x(15). 01 xml-string pic x(2000). *----option 2 definition---- 01 xml-doc redefines xml-string pic x(2000). *----option 2 definition---- 01 xml-doc redefines xml-string pic x occurs 2000 TIMES depending on xml-length . 01 xml-length comp-5 pic 9(4). 01 NUM-CHARS PIC 9(5). procedure division. X section. X-para. INITIALIZE xml-data INITIALIZE xml-string move "test" to field1 field2 field3 *>MOVE data to fields 1,2,3 XML GENERATE xml-string from start-of-data ON EXCEPTION DISPLAY 'XML generation error ' XML-CODE STOP RUN NOT ON EXCEPTION DISPLAY 'XML document was successfully generated.' END-XML XML PARSE xml-string PROCESSING PROCEDURE P ON EXCEPTION display "bad" NOT ON EXCEPTION display "good" END-XML. . goback. P section. evaluate xml-event when "1" continue end-evaluate.