Product Documentation

FairCom RTG COBOL Edition User's Guide

Previous Topic

Next Topic

xddgen

xddgen is used to generate XDD files directly from COBOL source code. Because xddgen must analyze the program to create the XDD, it needs a full COBOL program as input.

Usage

xddgen [options] file...

Options:

  • --help Display this message
  • --version, -V Display compiler version
  • -std=<dialect> Compile using a config file (config/<dialect>.conf) for a specific dialect (see xddgen Configuration File):

    acu ACUCOBOL-GT

    acu-Ds ACUCOBOL-GT using the -Ds switch

    cobol2002 COBOL 2002

    cobol85 COBOL 85

    ibm IBM Compatible

    mvs MVS Compatible

    bs2000 BS2000 Compatible

    mf Micro Focus Compatible

    default When not specified

    • When -std is not specified, config/default.conf is used.
  • -free Use free source format
  • -fixed Use fixed source format (default)
  • -o <directory> Place the output into <directory>
  • -I <directory> Add <directory> to copy/include search path
  • -conf=<file> User defined dialect configuration. See -std=
  • --list-reserved Display reserved words
  • --list-intrinsics Display intrinsic functions
  • --list-mnemonics Display mnemonic names
  • -save-temps(=<dir>) Save intermediate files (default current directory)

Some elements of COBOL FD statements require special consideration when generating the XDD. In particular:

Redefines

Fields contained in a redefining item occupy the same positions as the fields being redefined.

The XDD generator needs to select just one of the field definitions; by default it takes the fields in the item being redefined.

Multiple record definition

The same rule applies to multiple record definitions which are redefinitions of the entire record area, so again this leads to multiple definitions for the same data area. In this case the XDD generator picks the first definition.

Group items

By default never included in an XDD as they result in multiple names for the same data items.

FILLER Data Items

In a COBOL FD, FILLER data items are placeholders however they take space on the record area. FILLER items are not uniquely named, so when generating the XDD they get renamed to have a unique name and by default are marked as “hidden fields”.

Occurs

An OCCURS clause requires special handling because there must be a unique name to each database column. The XDD generator accomplishes this by expanding the OCCURS items and appending sequential index numbers to the items named in the OCCURS.

Primary Key

The xddgen utility (as well as ctutil -xfd2xdd) mark the first index as the primary in the XDD definition so that this key becomes the primary key for SQL.

In This Section

XDD Directives

Handling DATE Fields in Your XFD

Syntax for WITH DUPLICATES on RECORD KEY

Suppress Dash or Replace with Underscore

xddgen Configuration File

Configuration Files Directory

xddgen - New Configuration Option max-fixed-record-len

xddgen - New Record Size Checks and Warnings

TOCIndex