Use the Record Class Generator to break a COBOL or C data division structure into Smalltalk classes.
• The application must have as a prerequisite the application AbtRecordStructureBaseApp.For a C header file, all data types declared with typedef or struct can be used to generate a class. For a COBOL copy library file, the record formats declared by 01-level declarations can be used.
1. This window is similar to the Record settings page of the C and COBOL External Function parts.
3. Enter the name of the COBOL or C source file declaring the data types or records used by the external function. To list the available files, select Find.... To view the contents of a file, select View.
6. Choose Yes or No for Translate Data?. The default is No. If the file you will be accessing using the parsed structure contains binary data created on OS/390, the data needs to be converted. Select Yes if you want your binary data converted.You can also manually modify the getter and setter methods generated by the parser to convert between ASCII and EBCDIC for testing on the workstation. Update COBOL or C display field getter and setter methods with methods mvsFromEbcdic and mvsAsEbcdic respectively. When packaging for OS/390, you do not need to remove these methods from your generated classes; they become NOOP methods on OS/390.
a.
7. When you have specified the file you want to use, select Parse. A list of all the record and type definitions found appears in the Records to generate drop-down list. The name of each entry in the list is the name as it appears in the parsed file, converted to a valid Smalltalk class name. All underscores and dashes are removed, and the first character is capitalized if necessary.You can select a subset of the fields in a record and select Selected fields from the Generate menu if you want only a subset of the fields to be included in the generated class. You can also select fields and select Rename selected fields from the pop-up menu on the fields list to rename fields before generating the record class.
9. Select Generate >All Fields to generate selectors for all of the fields within the record that you specified. Select Generate >Selected Fields to generate selectors for the fields you selected within the record that you specified in the Records to generate list.
a. Enter the class name for generated selectors. Select OK. If the parser found constants defined in the parsed file, you will also be prompted to specify a pool dictionary name; the default will be the name of the generated selector concatenated with the word Constants.
b. Enter the name for the pool dictionary or select Cancel to proceed creating a pool dictionary.If the parsed file contains any constant definitions (level-78 and level-88 items for COBOL; #define items for C), a prompter will appear asking you to specify the name of a pool dictionary for the generated class. You can enter a valid global variable name or select Cancel to proceed with the record generation.The classes resulting from the parsed structure are subclasses of OsPtr unless data conversion is requested.When data conversion is requested, the Record Class Generator generates a class, that is a subclass of AbtForeignOSObject. If the class already exists, it will be overwritten in the application in which it was originally created. If it is a new class, it will be created in the application that you were browsing when you invoked the Record Class Generator. The generated class can always be moved to a different application as needed.To save a representation of your record for later editing, select Archival method from the Generate menu of the Record Class Generator. This adds a class method representing the record to the class you specify. You can use the method to reconstruct the selectors of the record.
![]() |