Format Builder
Importing Meta Data
BEA Format Builder includes the following four utilities that allow you to import COBOL copybooks, and convert a C structure definition into MFL Message Definition.
Importing an XML Schema
Format Builder includes a feature that allows you to import an XML Schema representing the desired XML representation of your non-XML document. This can provide you with a jump-start on specifying the format of your non-XML document.
To import an XML schema:
- Choose Tools—>Import—>XML Schema Importer. The XML Schema Importer dialog displays.
- Enter data in the fields as described in the following table:
|
Field
|
Description
|
|
File Name
|
Type the path and name of the file you want to import.
|
|
Browse
|
Click to navigate to the location of the file you want to import.
|
|
Root Element
|
This value will be used as the root element in the transformed XML document. This name must comply with XML element naming conventions
|
|
MFL Field Delimiter Default
|
A delimiter is a character that marks the end of the field. The field data continues until the field containing the delimiter character is encountered.
|
|
Action Buttons
|
|
OK
|
Imports the XML Schema using the settings you defined.
|
|
Cancel
|
Closes the dialog and returns to Format Builder without importing.
|
Importing a COBOL Copybook
Format Builder includes a feature that allows you to import a COBOL copybook into Format Builder and create a message definition to transform the COBOL data. When importing a copybook, comments are used to document the imported copybook and the Groups and Fields it contains.
To import a COBOL copybook:
- Choose Tools—>Import—>COBOL Copybook Importer. The COBOL Copybook Importer dialog displays.
- Enter data in the fields as described in the following table:
|
Field
|
Description
|
|
File Name
|
Type the path and name of the file you want to import.
|
|
Browse
|
Click to navigate to the location of the file you want to import.
|
|
Byte Order
|
|
Big Endian
|
Select this option to set the byte order to Big Endian.
Note: This option is used for IBM 370, Motorola, and most RISC designs (IBM mainframes and most Unix platforms).
|
|
Little Endian
|
Select this option to set the byte order to Little Endian.
Note: This option is used for Intel, VAX, and Unisys processors (Windows, VMS, Digital, Unix, and Unisys).
|
|
Character Set
|
|
EBCDIC
|
Select this option to set the character set to EBCDIC.
Note: These values are attributes of the originating host machine.
|
|
US-ASCII
|
Select this option to set the character set to US-ASCII.
Note: These values are attributes of the originating host machine.
|
|
Other
|
The character encoding of the field data.
|
|
Action Buttons
|
|
OK
|
Imports the COBOL Copybook using the settings you defined.
|
|
Cancel
|
Closes the dialog and returns to Format Builder without importing.
|
|
About
|
Displays information about the COBOL Copybook importer including version and supported copybook features.
|
Once you have imported a copybook, you may work with it as you would any message format definition. If an error or unsupported data type is encountered in the copybook, a message is displayed informing you of the error. You can choose to display the error or save the error to a log file for future reference.
Importing C Structures
Format Builder includes a C structure importer utility that converts a C structure definition into an MFL Message Definition by generating MFL or C Code output.
Starting the C Structure Importer
To start the C Structure Importer:
- From the Format Builder main window, choose Tools—>Import—>C Struct Importer. The C Structure Importer dialog displays.
- The C Structure Importer dialog opens with MFL specified as the default output and contains the following fields.
|
Field
|
Description
|
|
Input
|
|
|
Input File
|
Enter the path and name of the file you want to import. You can also click the Browse button to navigate to the file you want to import.
|
|
Structure
|
This list box is populated with the list of structures found in the input file after it has been successfully parsed.
|
|
Parse
|
Click Parse to parse the input file. If successful, the Structure list box is populated with the list of structures found in the input file.
|
|
Output
|
|
|
Name
|
Specify an existing profile either by entering the file name or using the Browse button.
|
|
MFL
|
Specifies the data must be compiled on the target machine to generate MFL.
|
|
C Code
|
Specifies the data must be compiled on the target machine to generate C code.
|
Generating MFL Data
Perform the following steps to generate MFL data.
- Enter a file name in the Input File field, or click Browse to select a file.
- Click Parse to parse the file.
Upon completion, the Structure list box is populated with the list of structures found in the input file.
- Select the desired structure from the Structure drop-down list box.
At this point, you must provide some profile configuration data to generate the MFL directly. You can do this by creating a new hardware profile, or specifying an existing profile.
- Specify an existing profile or create a new one by performing one of the following procedures.
- Specify an existing profile either by entering the file name in the Hardware Profile Name field, or click Browse to select a file. Click Edit to open the hardware profile editor if you need to view or edit the profile parameters.
- Click New to create a new hardware profile. This opens the Hardware Profile editor loaded with the default parameters. Specify a Profile Name, a description, and modify the primitive data types and byte order to suit your needs.
- Click OK to save your hardware profile changes and return to the C Structure Importer dialog.
- Click OK to generate your MFL. If the generation is successful, you are returned to Format Builder with an MFL object listed in the navigation tree. The MFL object reflects the same name as the input file used in the parse operation.
If errors are detected during the generation process, the MFL Generation Errors dialog displays providing you the opportunity to view or file the error log.
- Click Display Error Log to view any errors encountered, click Save Error Log to save the error log to the location of your choice, or click Cancel to dismiss the MFL Generation Errors dialog box.
Once you have determined what errors were generated, you can return to the C Structure Importer and repeat the prior steps.
Generating C Code
Perform the following steps to generate C code.
- Enter a file name in the Input File field, or click Browse to select a file.
- Click Parse to parse the file.
Upon completion, the Structure list box is populated with the list of structures found in the input file.
- Select the desired structure from the Structure drop-down list box.
- Select the C Code option button.
- Enter a file name in either the MFL Gen or Data Gen fields, or click Browse to select a file.
- Click OK. You will be warned about overwriting existing files and notified about the success or failure of the code generation.
- Copy the generated source code to the platform in question and compile and execute it.
Note: You must copy the input file containing the structure declarations as well. Both programs, when compiled, take an argument of the output file name.
- Copy the generated MFL or data back to the platform running Format Builder.