[Info-vax] Weird Cobol alignment issue.

Jan-Erik Soderholm jan-erik.soderholm at telia.com
Tue Apr 2 12:32:13 EDT 2013


David Froble wrote 2013-04-02 18:24:
> Jan-Erik Soderholm wrote:
>> Envir:
>> Compaq COBOL V2.8-1286
>> VMS 8.2 Alpha.
>>
>>
>> In a current project, an XML structure broke.
>>
>> One element of XML data looks like :
>>
>> ...
>> <TreatmentCode>05</TreatmentCode>
>> ...
>>
>> There are a number of XML elements with similar
>> declarations before and after that one.
>>
>> The data declaration was first like :
>>
>>  05 filler    pic x(15)       value '<TreatmentCode>'.
>>  05 mem101-xml-treat-code     pic 9(2).
>>  05 filler    pic x(16)       value '</TreatmentCode>'.
>>
>> This is in line with all other XML elements and
>> it worked "as expected" for a months of development
>> and created correct XML data.
>>
>> Now, suddenly this produced XML code like :
>>
>> ...
>> <TreatmentCode05</TreatmentCode>
>> ...
>>
>> Note the missing closing ">" before the value "05"!
>>
>> Currently I have to declare this specific element like :
>>
>>  05 filler    pic x(16)       value '<TreatmentCode> '.
>>  05 mem101-xml-treat-code     pic 9(2).
>>  05 filler    pic x(16)       value '</TreatmentCode>'.
>>
>> Note the extra space character at the end of first filler!
>> This produces the correct XML element, that is, the extra
>> space character is not included in the XML structure. Weird...
>>
>> I have not tried to create a reproducer, but has anyone
>> seen anything like this from the Cobol compiler?
>>
>> This doesn't feel particular stable, and I'm prepared to
>> backout this "fix" at any moment...
>>
>> Jan-Erik.
>>
>
> If you want to test this, set the trailing tag to 15 length and take out a
> letter.
>
> Is this the only tag with an odd number of characters ????

In the XML structure there are 28 "filler" parts with all
kind of odd and even lengths. The same for the intermixed
variables.

And, note that this did work OK for a month or so.
This is in a copy/include file and I have done a lot
of changes to it. I can't realy say when this happend.

It was the receiver of the XML data that saw that it
was broken. Everything built cleanly.

Jan-Erik.



More information about the Info-vax mailing list