5 DEFGEN Arguments
Learn how to use the runtime arguments for DEFGEN
utility. These arguments are entered at the command line when you run the utility.
DEFGEN
produces a file defining the layouts of the source files and
tables. The definitions are used by Collector and Replicat and, in some cases,
Extract.
For more information about using DEFGEN
, see Generating Data Definitions with DEFGEN.
5.1 Argument Summary
DEFGEN
accepts the following arguments.
Argument | Description |
---|---|
EXCLUDESYSTEM | INCLUDESYSTEM |
Instructs |
EXPANDDDL |
Supplies options to manipulate output for Enscribe record definitions. |
NCHARCOMPATIBILITY |
Sets the datatype to 0 from 2 for multibyte nchar and 64 from 66 for multibyte nvarchar. |
RECORDNAMEPROMPTING |
Supplies the name of an existing record definition to use when generating a definition for a new table. |
FORMAT RELEASE |
Specifies the trail format of the data that is sent by Extract to a trail, file, or (if a remote task). The value tells the reader process whether the data records are of a version that it supports. The format depends on the version of the Oracle GoldenGate process. Newer Oracle GoldenGate versions contain different characteristic than older ones. |
5.2 EXCLUDESYSTEM | INCLUDESYSTEM
Use EXCLUDESYSTEM
and INCLUDESYSTEM
to omit or include the NonStop system name from the files and tables for which definitions are being generated. Must precede the EXPANDDDL
argument.
Default
INCLUDESYSTEM
Syntax
EXCLUDESYSTEM | INCLUDESYSTEM
5.3 EXPANDDDL
Use EXPANDDDL
options to manipulate output for Enscribe record definitions containing arrays and redundant field names. This feature is primarily useful when mapping Enscribe files to SQL tables. It can also be useful when generating SQL tables based on Enscribe definitions using the DDLGEN
utility.
EXPANDDDL
is not necessary when the source database is NonStop SQL. If used, it must be the last argument entered.
Syntax
EXPANDDDLseparator
option
[, ...]
-
separator
-
A character separator for defining array output. See "Defining a separator".
-
option
-
For information about the options, see:
-
Information on inheriting
OCCURS
on "Inheriting OCCURS".
-
Defining a separator
Use separators for defining array output into columns. If any option besides NOEXPANSION
is specified, a distinct field is output for each occurrence of a given field and a grouping field with the original name.
For example, consider the DDL definition:
03 FIELDX PIC 9(5) OCCURS 2 TIMES.
Normally, the array is output as a single field with three occurrences. However, arrays do not exist in an SQL environment, so it may be desirable to create a column for each occurrence of FIELDX
. If the USEDASH
option is specified, the following fields are output:
FIELDX FIELDX-1 FIELDX-2
FIELDX
references all occurrences as a group item, while -1
and -2
are the individual occurrences.
If you are specifying a separator it must be the first option in the command string.
Default
USEDASH
Syntax
EXPANDDDL separator
separator
is one of the following.
Inheriting OCCURS
Use the EXPANDGROUPARRAYS
option to append indexes to fields that do not necessarily occur multiple times, but which are part of groups that occur multiple times.
Default
NOEXPANDGROUPARRAYS
Syntax
EXPANDDDL USEUNDERSCORE EXPANDGROUPARRAYS
Example
For the following definition:
03 A OCCURS 2 TIMES. 04 B PIC 9(5). 03 X OCCURS 4 TIMES. 04 Y PIC 9(5) OCCURS 4 TIMES.
B
within the second occurrence of A
becomes B_2
. The third occurrence of Y
within the fourth occurrence of X
becomes Y_4_3
.
Resolving duplicate field names
You can resolve duplicate file names by specifying a duplicate field option for:
-
Unique numerical index to the end of a duplicate field or column.
-
Unique alpha character index to the end of a duplicate field or column.
-
Group name at the beginning of a duplicate field or column.
Default
NORESOLVEDUPS
Syntax
EXPANDDDL dup_field_option
dup_field_option
is one of the following.
-
RESOLVEDUPINDEX
-
Appends a numerical index to the end of each duplicate field or column. For example,
END-DATE.YY
would becomeYY-2
in the output since it is the second occurrence ofYY
in the definition. -
RESOLVEDUPALPHAINDEX
-
Appends an alpha character index to the end of redundant fields or columns;
BEGIN-DATE.MM
would becomeMM-A
(occurrences are designatedA-Z
). -
RESOLVEDUPGROUP
-
Prefixes a duplicate field name with its group name and separator.
-
RESOLVEDUPFULLNAME
-
Use only when
RESOLVEDUPGROUP
cannot resolve duplicates.RESOLVEDUPFULLNAME
triggers the system to fully qualify the field name so that the redundancy is resolved. -
NORESOLVEDUPS
-
Do not resolve duplicate field names.
Examples
- Example 1
-
Consider the following definition.
03 BEGIN-DATE. 04 YY PIC 99. 04 MM PIC 99. 04 DD PIC 99. 03 END-DATE. 04 YY PIC 99. 04 MM PIC 99. 04 DD PIC 99.
BEGIN-DATE
andEND-DATE
duplicate theYY
,MM
andDD
field names. Normally these duplications would be resolved by referencing the higher level group item, such asBEGIN-DATE.DD
orEND-DATE.DD
. TheRESOLVEDUPGROUP
duplicate field option prefixes each duplicate field name with its group name, as inBEGIN-DATE-DD
andEND-DATE-DD
. - Example 2
-
In this example, the first non-redundant group above the elementary item is used for the prefix. For example,
END-DATE.DATE-DEF.YY
would becomeEND-DATE-YY
(DATE-DEF
is omitted).03 BEGIN-DATE. 04 DATE-DEF. 05 YY PIC 99. 05 MM PIC 99. 05 DD PIC 99. 03 END-DATE. 04 DATE-DEF. 05 YY PIC 99. 05 MM PIC 99. 05 DD PIC 99.
Omitting or including redefined fields
Use OMITREDEFS
or INCLUDEREDEFS
to omit or include redefined fields in the output definition. Including redefinitions has the following consequences.
-
DDLGEN
outputs a column for every elementary field item in the source definition, regardless of whether or not it redefines another field. -
When the Extract program specifies
FORMATASCII
orFORMATSQL
, the Collector outputs an ASCII field for each redefined field.
Default
OMITREDEFS
Syntax
EXPANDDDL [OMITREDEFS | INCLUDEREDEFS]
Fixing long field names
Use MAXCOLNAMELEN
to manage long field names. By default, the maximum field name length is 30. You can change this value with the MAXCOLNAMELEN
option.
When creating new field names to resolve duplicate occurrences, names occasionally exceed the length specified by MAXCOLNAMELEN
. When this happens, you are prompted for an alternative column name. To avoid the prompt, specify the NOFIXLONGNAMES
option after MAXCOLNAMELEN
.
MAXCOLNAMELEN
is invoked only with EXPANDGROUPARRAYS
or RESOLVEDUPGROUP
.
Default
FIXLONGNAMES
(prompt for an alternative column name)
Syntax
EXPANDDDL [MAXCOLNAMELEN length
| [NOFIXLONGNAMES]]
Altering field array display
Use ZEROFILL
to expand output definitions to a constant width, similar to:
EXPANDDDL USEUNDERSCORE ZEROFILL 3 EXPANDDDL USEUNDERSCORE ZEROFILL ARRAYWIDTH
Default
ZEROFILL
1
Syntax
EXPANDDDL {ZEROFILL width
} | {ARRAYWIDTH}
-
width
-
A value indicating the character width of the output.
-
ARRAYWIDTH
-
Specifies that the output width match the number of elements in the array.
- Example 1
-
If
ZEROFILL
ARRAYWIDTH
is specified for definition03 FLAG PIC X OCCURS 500 TIMES
, then occurrence 7 becomesFLAG-007
and occurrence 423 becomesFLAG
-423
. The width is equal to the occurrence frequency (500) and is three characters wide. - Example 2
-
Using the definition from the previous example and specifying
ZEROFILL
5
results in occurrence 7 becomingFLAG-00007
and occurrence 423 becomingFLAG-00423
.
5.4 NCHARCOMPATIBILITY
Use NCHARCOMPATIBILITY
to cause DEFGEN
to specify single byte data types for columns that are multibyte. The data type is changed from 2 to 0 for multibyte nchar columns and from 66 to 64 for multibyte nvarchar columns. Must precede the EXPANDDDL
argument.
Default
No change to the datatypes
Syntax
NCHARCOMPATIBILITY
5.5 RECORDNAMEPROMPTING
Use RECORDNAMEPROMPTING
to trigger DEFGEN
to prompt for the name of an existing record definition instead of a file. Use this parameter to enter the record name when the same definition is to be used for multiple tables with identical definitions made up of the same columns, column order, and data types. Must precede the EXPANDDDL
argument.
Default
File name prompting
Syntax
RECORDNAMEPROMPTING
5.6 FORMAT RELEASE
Specifies the trail format of the data that is sent by Extract to a trail, file, or (if a remote task). The value tells the reader process whether the data records are of a version that it supports. The format depends on the version of the Oracle GoldenGate process. Newer Oracle GoldenGate versions contain different characteristic than older ones.
FORMAT
is a required keyword
Syntax
FORMAT RELEASE major.minor
RELEASE
specifies an Oracle GoldenGate release version.
major is the major version number, and minor is the minor version number. The
X.x
must reflect a current or earlier, generally available (GA)
release of Oracle GoldenGate. Valid values are 9.0 through the current Oracle
GoldenGate X.x
version number, for example 11.2 or 12.1. (If you
use an Oracle GoldenGate version that is earlier than 9.0, then specify either 9.0
or 9.5.) The release version is programmatically mapped back to an appropriate
internal compatibility level.
Default
Current version of the process that writes to this trail.
Note:
UsingDEFGEN
for use with the Base24 User Exit D24, requires
FORMAT RELEASE 9.5
.