IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

COBOL using XML Parser


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pleonard

New User


Joined: 20 Sep 2006
Posts: 19

PostPosted: Mon Dec 15, 2008 5:17 pm
Reply with quote

I put EBCDIC in place of UTF-8 in the file, keep the MOVE FUNCTION DISPLAY OF with DBCS option (it is required when we use DISPLAY OF function) however, I got xml-code=317 again making move from ASCII to EBCDIC. Attempting to move from EBCDIC to ASCII I got xml-code=83.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Dec 15, 2008 6:43 pm
Reply with quote

The 83 is promising -- it indicates the XML parser recognizes the file as being ASCII but the encoding didn't match -- try encoding='iso8859-1' for this file since that would indicate Latin-I ASCII.

Also, note that error codes 1 to 99 are error codes that XML handles and supposedly allows you to continue; have you checked the output field with the 70 or 83 error codes?
Back to top
View user's profile Send private message
pleonard

New User


Joined: 20 Sep 2006
Posts: 19

PostPosted: Mon Dec 15, 2008 6:57 pm
Reply with quote

I changed the file to be 'iso8859-1' and resubmit and got xml-code=317. How can I interpose the xml-code 70 or 83 in my program ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Dec 15, 2008 7:25 pm
Reply with quote

You've hit the limits of my knowledge -- if there's anybody with XML expertise at your site, you need to talk over your problem with them. The 317 is not an error that can be continued; 70 or 83 allow you to set XML-CODE to zero and continue processing according to the manual.

The error codes you've posted are consistently encoding conflict errors -- where the file is EBCDIC and the encoding= option of XML does not reflect an EBCDIC encoding, or the file is ASCII and the encoding= option does not reflect an ASCII encoding. The difficulty is finding an encoding string (819 or iso8859-1 or whatever) that allows the ASCII file to be processed, or the EBCDIC file to be processed with encoding=1047 or whatever: EBCDIC would be better since the mainframe would allow you to view the output but getting it processed would be the first thing.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Dec 16, 2008 1:18 am
Reply with quote

Hello,

To return to an earlier part of the topic - it may be helpful to try re-creating the file and using this new file for continued testing. . .
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Dec 16, 2008 2:25 am
Reply with quote

OK, I looked at an old program I wrote a year and a half ago -- the data does not include any encoding=. So make sure your file is EBCDIC, remove the encoding= from the first line, and run your XMLPARSE again. This should get you past the XML error -- I got XML-CODE=0 by doing so.

If you absolutely have to have the encoding, make sure the file is in EBCDIC, check the compile listing for the CODEPAGE used, and set the encoding to that CODEPAGE -- I thought we used 1047 but found out 1140 is selected by looking at a compile output.
Back to top
View user's profile Send private message
pleonard

New User


Joined: 20 Sep 2006
Posts: 19

PostPosted: Tue Dec 16, 2008 2:36 am
Reply with quote

I tried this one too. In my last test I removed the total header from XML file but for both (with header and without encoding=utf-8) I got XML-CODE=-1. I'm not sure which is the encoding made to this file because it is obtained from another program (that generates this XML to me). Maybe this program can be messed up this file I'm not sure. Indeed my program is attempting to process a XML message and their encoding are different between them.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top