Redefines Clause - HP DDL D40 Reference Manual

Data definition language
Table of Contents

Advertisement

Definition Attributes

REDEFINES Clause

The REDEFINES clause assigns a new name and data structure to an existing
definition or record.
REDEFINES { field-name | group-name }
field-name
identifies the previous field in the definition or record currently being defined;
field-name is a DDL name.
group-name
identifies the previous group in the definition or record currently being defined;
group-name is a DDL name.
REDEFINES Clause Guidelines
The following points are guidelines for using the REDEFINES clause:
Redefining structures must start at the same level as the structures they redefine.
A redefining structure must immediately follow the structure it redefines except in
the case of multiple redefines where each redefining structure refers back to the
same original structure.
A redefining field must not have a VALUE clause, a MUST BE clause, or an
UPSHIFT clause.
Because the data type of a group is always alphanumeric, an attempt to redefine a
group containing binary items could produce unpredictable results.
A redefining structure must not be larger than the structure it redefines.
If you redefine an SQL VARCHAR field, the maximum size of the redefining field is
the length of the VARCHAR field, including the two-byte length field.
In pTAL or TAL, a redefining structure can be smaller than the structure it
redefines.
In COBOL, a redefining structure must not be smaller than the structure it
redefines. When REDEFINES and OCCURS clauses are at the same level, then
FILLER emitted results in an incompatible structure when compared with C, pTAL,
or TAL output. To avoid this, split REDEFINES and OCCURS into separate groups.
Whenever possible, DDL pads the smaller structure with FILLER fields to make it
the same size as the structure it redefines.
For C, DDL generates source code that combines the items of a REDEFINES
clause into a union. The C structure containing such a union has one more item
level than the corresponding DDL structure containing the REDEFINES clause.
This situation causes DDL to issue a warning message unless you include the
Data Definition Language (DDL) Reference Manual—426798-002
6- 32
REDEFINES Clause

Advertisement

Table of Contents
loading

Table of Contents