2.69 EXPANDDDL

Valid for

Extract, Replicat

Description

Use EXPANDDDL to format Enscribe data. Enscribe DDL definitions frequently contain occurs, or array items. For example, a definition might contain:

05 GROUP1 OCCURS 3 TIMES.
   10 FIELD1 PIC X(5) OCCURS 20 TIMES.

To reference items within arrayed structures in a WHERE, FILTER, or COLMAP clause, you must identify the occurrence. The default syntax for doing so is: field_name-occurrence. For example, to retrieve the second occurrence of FIELD1 in the third group, the syntax would be GROUP1-3.FIELD1-2

The EXPANDDDL parameter changes this array notation. For example:

  • EXPANDDDL USEBRACKETS specifies field as GROUP1[3].FIELD1[2]

  • EXPANDDDL USETWOUNDERSCORES, ZEROFILL ARRAYWIDTH specifies field as GROUP1__3.FIELD1__02, when the maximum array width in GROUP1 is less than 10 (requiring at most one digit) and the maximum array width of FIELD1 is 20 (requiring two digits).

EXPANDDDL also determines how field occurrences are output when or FORMATSQL are specified.

Syntax

EXPANDDDL format 
[, ZEROFILL width | ARRAYWIDTH]
[, INCLUDEREDEFS | OMITREDEFS]

[, RESOLVEDUPINDEX]
[, RESOLVEDUPGROUP]
[, EXPANDGROUPARRAYS]
format

Can be one of the following:

  • USEDASH — Reference array items by –n, where n is the occurrence number.

  • USEBRACKETS — Reference array items by [n], where n is the occurrence number.

  • USEUNDERSCORE — Reference array items by _n, where n is the occurrence number.

  • USETWOUNDERSCORES — Reference array items by __n, where n is the occurrence number.

ZEROFILL width | ARRAYWIDTH

Directs Extract to reference occurrences of each field adjusting for a maximum width.

INCLUDEREDEFS | OMITREDEFS

INCLUDEREDEFS includes redefined fields.

OMITREDEFS is the default. It excludes redefined fields, which has the following consequences:

  • Data is only output to columns that do not redefine another field.

  • When Extract specifies FORMATASCII or FORMATSQL, Extract does not output redefined fields.

RESOLVEDUPINDEX

Appends a numerical index to the end of each duplicate field or column. For example, END-DATE.YY would become YY-2 in the output since it is the second occurrence of YY in the definition.

RESOLVEDUPGROUP

Prefixes a duplicate field name with its group name and separator.

EXPANDGROUPARRAYS

Appends indexes to fields that do not necessarily occur multiple times, but which are part of groups that occur multiple times.