In order for the annotations to be ignored by the COBOL compiler, the annotations have to appear as a comment line. Therefore, COBOL annotations always have an asterisk (*) in column 7 to indicate a COBOL comment.
The format of the annotation indicator for COBOL annotations have an optional eye-catching format. In this description, an @ ("at" sign) is used. However, any other character can be defined as the annotation indicator. The annotation indicator is positioned in column 1 followed by up to 5 alphanumeric characters.
To enable the annotation capability, the user has to create a synonym action XML file. The synonym action XML file is an XML file that defines a set of annotation words that are equivalent, in meaning to the actions already provided by the ItemExclusionArray, ItemSelectionArray, and XMLNameArray elements of the batch processor options file.
The user specifies (creates) the synonym action XML file on the command line when invoking the Batch processor (xsebatch). The comand is: xsebatch [-annot synFile]. For a complete description of the xsebatch command, see Starting the batch processor.
If the synonym action XML file is specified in this way, the annotation rules specified in the synonym action XML file apply to all Batch processor specification files (and therefore all subsequent services) generated in that particular invocation.
User can override (i.e., change) the synonym action XML file specified on the command line by using the "annotationsFile" attribute for input and output message elements (InputMessage and OutputMessage) in the Batch processor option specification file (ServiceSpecification.xml), see InputMessage and OutputMessage.
When the command line method is used to create and specify the synonym action XML file, the Batch processor ignores the ItemExclusionArray, ItemSelectionArray, and XMLNameArray elements of the batch processor options files and instead looks for the source data annotations that are defined in the synonym action XML file.
<?xml version="1.0" encoding="UTF-8"?>
<synactions:SynonymActions xmlns:synactions="http://www.ibm.com/xmlent/annot/emf/synactions">
<synactions:ActionGroup lang="COBOL" format="fixed" indicator="@ANN">
<synactions:ExcludeItem>
<synactions:itemName annotatedAs="OMIT"/>
</synactions:ExcludeItem>
<synactions:ItemSelection>
<synactions:itemName annotatedAs="KEEP"/>
</synactions:ItemSelection>
<synactions:XMLNameSelection>
<synactions:itemName annotatedAs="OLDNAME"/>
<synactions:xmlName annotatedAs="NEWNAME"/>
</synactions:XMLNameSelection>
</synactions:ActionGroup>
</synactions:SynonymActions>
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soannot="http://www.ibm.com/xmlent/annot/emf/synactions"
targetNamespace="http://www.ibm.com/xmlent/annot/emf/synactions">
<xsd:element name="itemName">
<xsd:complexType>
<xsd:attribute use="required" name="annotatedAs" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="ExcludeItem">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" ref="soannot:itemName"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="XMLNameSelection">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" ref="soannot:itemName"/>
<xsd:element minOccurs="1" maxOccurs="1" ref="soannot:xmlName"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ItemSelection">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" ref="soannot:itemName"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ActionGroup">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" ref="soannot:ExcludeItem"/>
<xsd:element minOccurs="1" maxOccurs="1" ref="soannot:ItemSelection"/>
<xsd:element minOccurs="1" maxOccurs="1" ref="soannot:XMLNameSelection"/>
</xsd:sequence>
<xsd:attribute use="required" name="indicator" type="xsd:string"/>
<xsd:attribute use="optional" name="lang" type="xsd:string"/>
<xsd:attribute use="optional" name="format" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="xmlName">
<xsd:complexType>
<xsd:attribute use="required" name="annotatedAs" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="SynonymActions">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" ref="soannot:ActionGroup"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
or