Running the COBOL RecordClassGenerator

The COBOL RecordClassGenerator requires the adatafile option to specify the location of the ADATA file. All of the other options use default values. When you run IBM® Record Generator for Java™, make sure that your Java CLASSPATH points to the ibm-recgen.jar. If you run on a non-z/OS platform, you must also include in the CLASSPATH the ibmjzos.jar file from the IBM SDK for z/OS Java Technology Edition.

For descriptions of all the available options, see Syntax of COBOL RecordClassGenerator.

Examples

This example uses the language structure MY-RECORD within the USER.COBOL.ADATA(MYRECORD) PDS member and generates the source for a Java helper class file that is called MyRecord.java within the Java package cobol.records. This is written to the directory generatedClasses/cobol/records, based on the concatenation of the values on the ouputdir and package options.

java com.ibm.recordgen.cobol.RecordClassGenerator \        
     adataFile="//'USER.COBOL.ADATA(MYRECORD)'" \ 
     package=cobol.records \   
     class=MyRecord \
     symbol=MY-RECORD \   
     outputdir=generatedClasses

This example uses, by default, the first 01 level data structure that is found within the myRecord.adata file, and generates the source for a Java helper class file that is called MyRecord.java within the Java package cobol.records. This is written to the directory generatedClasses/cobol/records.

java com.ibm.recordgen.cobol.RecordClassGenerator \        
     adatafile=myRecord.adata \
     package=cobol.records \
     class=MyRecord \
     outputdir=generatedClasses


cobol_running_rcg.html | Timestamp icon Last updated: Sunday, 13 October 2019