Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Generating Java classes without Ant

The generation procedure described above is usable limited for batch processing and bulk data operations.

If you are in the Cobol2Java home directory you can call the following command in order to perform a large number of generations on the basis of your own specifications.

java -Xss8m -Xmx512m -classpath lib/BeanConnectCob2java.jar 
de.siemens.cob2java.Cob2Java [-undef.pic9=<default-value>] <xml_file> 
<package_name> 
<code_convention>
<cobol_struct1> [<cobol_struct2> ...] 

Description of the parameters:

undef.pic9=<default-value>

undef.pic9 specifies the specific value for Pic9 fields that is to represent "undefined". For details, see the description of undef.pic9 in Generating Java classes with Ant .

<xml_file>

Name of the XML file containing the description of the COBOL data structures.

<package_name>

Package name for the generated classes.

<code_convention>

Convention used by the generated classes: cobol or java.

When using this parameter, please note the comments concerning the code.convention parameter on Generating Java classes with Ant .

<cobol_struct>[1...<n>]

Space-separated list of COBOL structures that are to be converted. At least one name must be specified.

Since some of the tools used here require a large amount of memory, it is generally necessary to use the options -Xss (stack size) and -Xmx (heap size) and make the required adaptations for large data structures. In Unix/Linux systems, it may also be necessary to adapt the stack size limit using the ulimit command.

Example 28 Generating Java classes

java -Xss8m -Xmx512m -classpath lib/BeanConnectCob2java.jar
de.siemens.cob2java.Cob2Java cobkb.xml de.cobol java MPUT-MSG BENID

This program simply generates the Java classes in the subdirectory src. It does not perform any compilation or create any JAR files or documentation.

An example can be found in the script xml2java.sh on Unix/Linux systems or xml2java.cmd on Windows systems. 

Make sure that the DTD newformat.dtd is located in the same directory as the XML file. You can find a copy of newformat.dtd in the directories lib and samples.