You can use the cbl2xml utility to:
cbl2xml runs at a command prompt, reads a COBOL record, and generates several files. It is not case sensitive (applies to Windows environments only). Use the following command-line syntax:
cbl2xml filename
[-c cpyBook]
[-x schemaFile]
[-m mapFile]
[-p prefix]
[-d directiveFile]
[-v validationFile]
[-noprompt]
[-nocountin]
[-fixedfraction][1]
Where the parameters are:
filename | The input file for
cbl2xml.
|
cpyBook | The filename of a COBOL copybook (.cpy file). cbl2xml generates this file to contain COBOL with XML syntax extensions. If you do not specify this parameter, cbl2xml names the generated file using the name of the COBOL or copybook with -cbl2xml appended to it. For example, if you specify a COBOL program file named account.cbl, the default filename for the copybook containing XML syntax extensions created by cbl2xml is account-cbl2xml.cpy. |
schemaFile | The filename of a schema file to be created. If you do not specify this parameter, cbl2xml names the schema file the same as the COBOL file, but with an .xsd extension. For example, if you specify a COBOL program file named account.cbl, the default filename for the schema created by cbl2xml is account.xsd. |
mapFile | The filename of a map file to be created, or the name of an existing map file. The following rules apply:
For more information on map files, see the section Mapping COBOL Data to XML Elements. |
prefix | Specify a prefix to prepend to generated data names. Use this parameter to create data records that are structured the same
as the data records in your COBOL file, but that have different data names. This is useful when you want to keep the original
data records intact and supply alternative data names for XML use.
The prefix takes the form of a character string. For example, if you specify -p xml-, cbl2xml prepends xml- to the beginning of each data name it generates. |
directiveFile | If you normally use a Compiler directive file to compile the COBOL program or copybook you are XML-enabling, specify that
directive file each time you use
cbl2xml.
For more information on directive files, see the topic Compiler Directives. |
validationFile | The filename of an XML schema or instance document you want to validate. The following rules apply:
|
-noprompt | Specify this argument when you want
cbl2xml to overwrite existing files automatically.
CAUTION:
-noprompt overwrites all files generated by
cbl2xml, including map files you have edited, and schema files supplied by third parties. Do not use this parameter unless you are
sure you want to overwrite these.
|
-nocountin | Specify this argument to prevent the generation of COUNT IN clauses for generated COBOL data items. This option overrides any values specified in a CBL2XML mapping file. |
-fixedfraction[1] | This argument sets the fractionDigits to the exact number of fractional digits instead of the maximum number of fractional digits. |