Created On: 25 May 2012
Problem:
When using the XML GENERATE statement in my COBOL program datanames are all being converted to upper-case when they appear in the XML as tags.
Is there a way to get it to retain the case that is specified for the datanames in the program?
Example:
01 Customer.
05 CustName pic x(20) value "Mike".
05 CustCompany pic x(20) value "Micro Focus".
01 xml-doc pic x(100).
XML GENERATE xml-doc from Customer
results in:
MikeMicro Focus
Is there a way to get it to retain the case that is specified for the datanames in the program?
Example:
01 Customer.
05 CustName pic x(20) value "Mike".
05 CustCompany pic x(20) value "Micro Focus".
01 xml-doc pic x(100).
XML GENERATE xml-doc from Customer
results in:
MikeMicro Focus
Resolution:
You can retain the mixed case used in the datanames by using the compiler directive:
$set preservecase
Example:
01 Customer.
05 CustName pic x(20) value "Mike".
05 CustCompany pic x(20) value "Micro Focus".
01 xml-doc pic x(100).
XML GENERATE xml-doc from Customer
results in:
MikeMicro Focus
$set preservecase
Example:
01 Customer.
05 CustName pic x(20) value "Mike".
05 CustCompany pic x(20) value "Micro Focus".
01 xml-doc pic x(100).
XML GENERATE xml-doc from Customer
results in:
MikeMicro Focus
Incident #2575496
Old KB# 35973
#VisualCOBOL
#ServerExpress
#netexpress
#COBOL