Declares an overlay of a Data Structures' subfields for mapping the field to an element of the array. DclOverlayGroup cannot contain subfields which overlay other fields in the data structure.
DCLOVERLAYGROUP
Name (name)
Dim (Integer Literal)
Type (*BINARY | *BOOLEAN | *BYTE | *CHAR | *DATE | *DECIMAL | *FLOAT | *FLOAT4 |
*FLOAT8 | *IND | *INTEGER | *INTEGER2 | *INTEGER4 | *INTEGER8 | *ONECHAR |
*PACKED | *TIME | *TIMESTAMP | *ZONED)
Len (Integer Literal, Interger Literal)
StartField (field-name)
Like (Field name)
Required. The name of the overlay group.
Required. The number of elements in the single-dimension array. Dim, together with the StartField parameter, defines how many consecutive fields of the DS will be part of the mapping.
Optional. Type can be any of Special Value ( i.e., *CHAR, *BINARY, etc.) or it can be a class name. If Type is *BOOLEAN or *IND, you can use *ON, *TRUE, *ON and *FALSE figurative constants to indicate true and false and "1" and "0", respectively.
If a Type parameter is not given, the Len parameter is required. In this case, *CHAR is assumed if there is one integer given and *ZONED is assumed if there are two integers. The Type of array must be the same as the declared data structure subfields it's mapping to.
Optional. Len specifies the length of the field. If Len is decimal e.g. Len (3,1) *ZONED is assigned as the default. If Len is character e.g. Len (3), *CHAR is assigned as the default.
If Type is packed, then the length is not the number of bytes the packed field fits into, but rather the logical digit length of the field. For example, if you want a 7 digit packed with 2 decimals, code Len (7,2). The Len must be the same as the declared data structure subfields it's mapping to.
Required. StartField contains the name of the subfield within the declared data structure at which the overlay group starts. This must be the name of a subfield defined previously in the current data structure. StartField, together with the Dim parameter, defines how many consecutive fields of the DS will be part of the mapping.
Optional. Like must be the name of a field already defined in the class. Type cannot be a named constant or a literal. In this case, the field will be defined based on the attributes of another field. If Type is an array, array element, or a table name, the attributes of an element of the array or table are used to define the field. You can use Len parameter to make the declared field longer or shorter than the Like parameter entry.
A plus sign (+) preceding the number indicates a length increase; a minus sign (-) indicates a length decrease. You cannot change the number of decimal positions for the field being defined. The field length entry is allowed only for field definitions requiring a length.
DclOverlayGroup cannot contain subfields which overlay other fields in the data structure.
// Declare a simple data structure with two subfields with an overlay group of the data structure DCLDS myDS DCLDSFLD CSSales01 Type(*Packed) Len(11,2) DCLDSFLD CSSales02 Type(*Packed) Len(11,2) DCLOVERLAYGROUP SalesArr Dim(2) Type(*Packed) Len(11,2) StartField(CSSales01)
// Declare a simple data structure with 6 subfields with one overlay of the first AND last 3 subfields DCLDS myDS DCLDSFLD CSSalesJan Type(*Packed) Len(11,2) DCLDSFLD CSSalesFeb Type(*Packed) Len(11,2) DCLDSFLD CSSalesMar Type(*Packed) Len(11,2) DCLDSFLD CSSalesApr Type(*Packed) Len(11,2) DCLDSFLD CSSalesMay Type(*Packed) Len(11,2) DCLDSFLD CSSalesJun Type(*Packed) Len(11,2) DCLOVERLAYGROUP SalesFirstQtr Dim(3) Type(*Packed) Len(11,2) StartField(CSSalesJan) DCLOVERLAYGROUP SalesLastQtr Dim(3) Type(*Packed) Len(11,2) StartField(CSSalesApr)