Skip to main content

We receive a lot of invoices in XML format from our suppliers. All have the header

<?xml version="1.0" encoding="UTF-8"?>

 and should be in that format.  Unfortunately some do not fulfill this format and have some fields filled with ASCII characters (not UTF-8 as it should be), including accented vowels á é í ó ú.   X”F3”  X”E9”  X”E1”  X”FA” etc.

The Internet Explorer does not open/show the file due to this wrong codification.

 

My program has the

ENVIRONMENT DIVISION.

FILE-CONTROL.

select factura-XML assign to ID-ARCHIVO-FAC

                     file status is file-status-spec.

 

The program generally works very fine if the XML is encoded right and reads all fields. But if the READ statement tries to read such a malformed file, the status does not report any error code, but aborts the program with a 114 error code.

What must I do to receive an error code instead of aborting the program?

I have no chance to examine the   file-status-spec and inform the operator, because the program aborts immediately with the message

 

Execution error: file LEC-XML5

error CODE 114, PC=0, CALL=1, SEG=0

114 Attempt to access item beyond bounds of memory (Signal 11)

 Thanks for any help

Rolf


#XMLUTF-8

We receive a lot of invoices in XML format from our suppliers. All have the header

<?xml version="1.0" encoding="UTF-8"?>

 and should be in that format.  Unfortunately some do not fulfill this format and have some fields filled with ASCII characters (not UTF-8 as it should be), including accented vowels á é í ó ú.   X”F3”  X”E9”  X”E1”  X”FA” etc.

The Internet Explorer does not open/show the file due to this wrong codification.

 

My program has the

ENVIRONMENT DIVISION.

FILE-CONTROL.

select factura-XML assign to ID-ARCHIVO-FAC

                     file status is file-status-spec.

 

The program generally works very fine if the XML is encoded right and reads all fields. But if the READ statement tries to read such a malformed file, the status does not report any error code, but aborts the program with a 114 error code.

What must I do to receive an error code instead of aborting the program?

I have no chance to examine the   file-status-spec and inform the operator, because the program aborts immediately with the message

 

Execution error: file LEC-XML5

error CODE 114, PC=0, CALL=1, SEG=0

114 Attempt to access item beyond bounds of memory (Signal 11)

 Thanks for any help

Rolf


#XMLUTF-8

Hi Rolf,

Are you using the ORGANIZATION IS XML definition for your file? Otherwise you are just reading this as a sequential file which would know nothing about XML constructs.

I would recommend opening up a support incident with Customer Care so that we can take a look at your code and try to reproduce in-house.

Thanks.