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 USEBRACKETSspecifies field asGROUP1[3].FIELD1[2] -
EXPANDDDL USETWOUNDERSCORES, ZEROFILL ARRAYWIDTHspecifies field asGROUP1__3.FIELD1__02, when the maximum array width inGROUP1is less than 10 (requiring at most one digit) and the maximum array width ofFIELD1is 20 (requiring two digits).
EXPANDDDL also determines how field occurrences are output when or FORMATSQL are specified.
Syntax
EXPANDDDL format
[, <a id="d51046e114"></a><a id="d51046e118"></a>ZEROFILL width | ARRAYWIDTH]
[, <a id="d51046e127"></a>INCLUDEREDEFS | <a id="d51046e134"></a>OMITREDEFS]
[, RESOLVEDUPINDEX]
[, RESOLVEDUPGROUP]
[, EXPANDGROUPARRAYS]
format
Can be one of the following:
-
USEDASH— Reference array items by-n, wherenis the occurrence number. -
USEBRACKETS— Reference array items by[n], wherenis the occurrence number. -
USEUNDERSCORE— Reference array items by_n, wherenis the occurrence number. -
USETWOUNDERSCORES— Reference array items by__n, wherenis 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
FORMATASCIIorFORMATSQL, 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.