Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

XML Parse in COBOL - got Error code 2 Exception

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Mon Jul 16, 2012 9:53 am    Post subject: XML Parse in COBOL - got Error code 2 Exception
Reply with quote

Hi,

I am working on XMLParse in CICS COBOL program. When I try to parse the below XML, I am getting Exception error after the XML declaration statement. My program parses till Standalone Declaration. While parsing the comment statement, I am getting Exception error code "2".

When i ran the same XML in batch (COBOL), its working fine. Please help me to solve this.


XML Scritp:

<?xml version="1.0" encoding="IBM-1140" standalone="yes"?> <!--this document is just an example--><customer-Details> <customer-name>Company Name.</customer-name> <employee-Details> <employee> <emp-name>AAAAAA</emp-name> <emp-pan-no>A111111111</emp-pan-no> <emp-location>KARNATAKA</emp-location> <emp-designation>S/W ENGING</emp-designation> <emp-salary>100000</emp-salary> <emp-on-bench>NO</emp-on-bench> <project-name>Mainframe</project-name> </employee> <employee-Details><customer-Details>
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jul 16, 2012 10:20 am    Post subject:
Reply with quote

Hello,

As it is rather late here and i suspect rather early there, i'll give this a shot.

I've not done much xml, but is the posted xml correct? There are no terminators for <employee-Details><customer-Details> that i can see . . .
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Mon Jul 16, 2012 10:32 am    Post subject:
Reply with quote

Sorry, I have missed the terminator while editing this XML script. Please find the correct one below.

<?xml version="1.0" encoding="IBM-1140" standalone="yes"?> <!--this document is just an example--><customer-Details> <customer-name>Company Name.</customer-name> <employee-Details> <employee> <emp-name>AAAAAA</emp-name> <emp-pan-no>A111111111</emp-pan-no> <emp-location>KARNATAKA</emp-location> <emp-designation>S/W ENGING</emp-designation> <emp-salary>100000</emp-salary> <emp-on-bench>NO</emp-on-bench> <project-name>Mainframe</project-name> </employee> </employee-Details></customer-Details>
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8120
Location: East Dubuque, Illinois, USA

PostPosted: Mon Jul 16, 2012 2:20 pm    Post subject:
Reply with quote

Since byte 80 occurs in the middle of the comment statement, I suspect what you show as the XML is not exactly how it is being presented to the CICS program.

Where is this XML coming from?
If it is coming from a file, what is the record length of the file?
If it is coming from a terminal, how do you combine the various lines to create a single variable to use the XML PARSE verb on?
If it is coming from somewhere else, how long are the records being passed to your CICS program?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2435
Location: Netherlands, Amstelveen

PostPosted: Mon Jul 16, 2012 2:35 pm    Post subject:
Reply with quote

Exception 2 :

The parser found an invalid start of a processing instruction, element, comment, or document type declaration outside element content.
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Mon Jul 16, 2012 3:32 pm    Post subject:
Reply with quote

The XML message is received from MQ Queue. The same opens,Read the XML message from MQ. And it prase the received XML message to applicaiton data.

I have ran the same program with the above XML (removed the comment line) message. Its working fine. Please help to find the issue in XML comment line.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2435
Location: Netherlands, Amstelveen

PostPosted: Tue Jul 17, 2012 1:38 pm    Post subject:
Reply with quote

All XML comments i did see on the internets are starting/ending with a space, contrary to your XML comment. Don't know if that makes the difference.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts XML Parse for large file muralikrishnan_new COBOL Programming 3 Mon Jun 12, 2017 12:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us