Special Considerations for Expandable Groups
- Fields starting with the same prefix as expandable groups (#XG_) cannot be included in expandable groups. When an entry starting with this prefix is found in the FIELDS parameter of an expandable group GROUP_BY definition, the RDML full function checker will handle it as a group name, not as a field name.
- Expandable groups must be defined before they can be referenced. In this aspect, expandable groups differ from conventional groups in that the placement of the GROUP_BY definition within the function is important.
- Conventional groups are not allowed in the FIELDS parameter of an expandable group.
- The following limits apply:
- Up to 100 expandable groups can be defined in a function.
- Up to 100 fields can be grouped into an expandable group. At no time during the expansion can the field list go beyond this limit, even if some fields will be excluded from the list later in the expansion.
- Up to 999 fields altogether can be defined in expandable groups within a function.
Expandable groups may be defined as follows:
GROUP_BY NAMED(#XG_CUST) FIELDS(#CUSTNO #CUSTNM #ADDR1 #ADDR2
#POSTCD)
GROUP_BY NAMED(#XG_PRKY) FIELDS(#GROUP #PRODNO)
GROUP_BY NAMED(#XG_PROD) FIELDS(#XG_PRKY #DESC #CLASS #PRICE
#BARCOD)
GROUP_BY NAMED(#XG_ORD) FIELDS(#XG_CUST #XG_PROD)
and then used like this:
FETCH FIELDS(#XG_CUST) FROM_FILE(CUSMST)
FETCH FIELDS(#XG_PROD) FROM_FILE(PRDMST) WITH_KEY(#XG_PRKY)
DISPLAY FIELDS(#XG_ORD)