What is IBM Record Generator for Java?
IBM® Record Generator for Java™ 3.0 is a stand-alone Java utility that generates Java helper classes to describe language-specific record structures. These helper classes can then be used in a Java application to marshal data to and from the byte-oriented record structures that are commonly used in z/OS applications, such as CICS COMMAREAs or VSAM files.
IBM Record Generator for Java 3.0 supersedes the alphaWorks version of the JZOS Record Generator V2.4.6, and provides new capabilities. For a summary of the new capabilities, see What's new?.
- For COBOL copybooks, implemented by the RecordClassGenerator class in the supplied com.ibm.recordgen.cobol Java package.
- For assembler-language DSECTs, implemented by the RecordClassGenerator class in the supplied com.ibm.recordgen.asm Java package.
The RecordClassGenerator class reads as input the ADATA output from the IBM Enterprise COBOL for z/OS Compiler or the IBM High Level Assembler and generates Java source code to map a selected language-specific record structure.
The source that is generated by the RecordClassGenerator uses the com.ibm.jzos.fields API package from the IBM JZOS Toolkit, which contains data type converters for the elemental COBOL and assembler data types. An additional class, RecordXMLGenerator, can generate an XML representation of the imported language structures that can be modified in third-party tools, such as XSLT, then used as input to the RecordClassGenerator to generate the Java helper classes.
After it is generated, the source code of the Java helper classes can be compiled with the com.ibm.jzos.fields package to produce a Java class that has accessors for each individual field in the record. Each field in the record can be written to using the appropriate setter method and also read through a corresponding getter method. The entire byte array that represents the record can also be referenced by using the supplied getByteBuffer() method. This greatly simplifies the development of Java applications that need to interact with structured enterprise data.