First, let me apologize if I use wrong vocabulary, as I'm not too familiar with COBOL. We are trying to generate xml documents from a fixed data structure in COBOL. This is working well, using the GENERATE statement, but we have an issue.
If the data is the following:
First;Second;Age;Optional
JOHN;SNOW;18;Something
JOHN;DOE;45;Nothing
JOHN;ISSUE;30;
Then the generated xml looks like this:
<Persons>
<Person First="JOHN" Second="SNOW" Age="18" Optional="Something"/>
<Person First="JOHN" Second="DOE" Age="45" Optional="Nothing"/>
<Person First="JOHN" Second="ISSUE" Age="18" Optional=""/>
</Persons>
When we would like the generator not to create the attributes when they have an empty value:
<Persons>
<Person First="JOHN" Second="SNOW" Age="18" Optional="Something"/>
<Person First="JOHN" Second="DOE" Age="45" Optional="Nothing"/>
<Person First="JOHN" Second="ISSUE" Age="18" />
</Persons>
Is there an easy way to acheive this ? Been looking around in IBM documentation and on google, with no luck.