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 asGROUP1[3].FIELD1[2]
-
EXPANDDDL USETWOUNDERSCORES, ZEROFILL ARRAYWIDTH
specifies field asGROUP1__3.FIELD1__02
, when the maximum array width inGROUP1
is less than 10 (requiring at most one digit) and the maximum array width ofFIELD1
is 20 (requiring two digits).
EXPANDDDL
also determines how field occurrences are output when or FORMATSQL
are specified.
Syntax
EXPANDDDLformat
[, ZEROFILLwidth
| ARRAYWIDTH] [, INCLUDEREDEFS | OMITREDEFS] [, RESOLVEDUPINDEX] [, RESOLVEDUPGROUP] [, EXPANDGROUPARRAYS]
-
format
-
Can be one of the following:
-
USEDASH
— Reference array items by–n
, wheren
is the occurrence number. -
USEBRACKETS
— Reference array items by[n]
, wheren
is the occurrence number. -
USEUNDERSCORE
— Reference array items by_n
, wheren
is the occurrence number. -
USETWOUNDERSCORES
— Reference array items by__n
, wheren
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
orFORMATSQL
, 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 becomeYY-2
in the output since it is the second occurrence ofYY
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.