Hi Alexandre,
>1- how do we indicate a particular Charset on a cobol field ? For
>instance, having EBCDIC as a general charset and ASCII or UTF-8 on
>specific fields
As a general rule you cannot specify a charset at the field level. The
mainframe charset that you set on the transformer affects all fields
marked ALPHANUMERIC_ITEM. This being said, there are 2 things you might try:
For fields you want to keep in ASCII, you can change their type in the
XSD from ALPHANUMERIC_ITEM to OCTET_STREAM_ITEM and their XSD
restriction base from string to hexBinary. This is an example:
<xs:element name="Test1Ascii">
<xs:annotation>
<xs:appinfo>
<cb:cobolElement levelNumber='05' cobolName='TEST1-ASCII'
type='OCTET_STREAM_ITEM' picture='XX' usage='DISPLAY' srceLine='4'/>
</xs:appinfo>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:hexBinary">
<xs:length value='2'/>
</xs:restriction>
</xs:simpleType>
</xs:element>
This will translate to a byte[] JAXB member variable. LegStar does not
attempt to convert such fields.
Otherwise, there is no direct support for UTF-8 in COBOL but there is
support for UTF-16. IF the COBOL field is defined as NATIONAL. For example:
05 C-NATIONAL PIC N(9).
These are normally handled by LegStar (The COBOL program receives UTF-16).
>2- default value not assigned when unmarshaling Jaxb bean to copybook
>data
This is a limitation we have with LOW_VALUES or HIGH_VALUES. The issue
is that field initialization and setting is handled at the JAXB level at
the moment. There is no equivalent to LOW_VALUES and HIGH_VALUES in java.
This being said, we could recognize specific string content such as
"LOW_VALUES" which is unlikely to conflict with actual string values.
Please file an enhancement request at
http://code.google.com/p/legstar/issues/list if this is of interest to you.
Let us know how your testing goes.
Fady