As a 14-character
string the TELEPHONE attribute values are stored as:
The new, group attribute
has the area code broken out, and trailing the main number, but specified
as three different attributes as follows:
Therefore, while
the original RD entry might have been as follows:
FIELD TELEPHONE TEXT LENGTH 14
|
|
The new RD entries
will have to accommodate the changed definition of the attribute.
Record
Design
TOne school of thought
in dataset design is to arrange the attributes of a dataset to exactly
match the order of the data values in the input file specification. The
other school of thought arranges the attributes in the order that are
of best use to the application, and then uses a customised RD to read
the data values from the input file into the appropriate attributes.
As System 1032 matches
the RD fields to the attributes via primary name, either approach is as
efficient as the other.
The RD used for matching
the exact order of the data values generally uses the LENGTH quality to
pick up the data values.
However, in this
case, the order of the new atttributes does not match the original order
of the data value. This can be addressed either by using the COLUMN quality
of FIELD, as follows. (The column values assume the TELEPHONE value begins
in the first position in the input record.)
Field SEVEN_DIGITS Text Column 4 10 Field EXTENSION Text Allow End_Spaces Column 11 14 Field AREA_CODE Text Column 1 3
|
|
Or the fields of
the RD itself can be re-arranged to pick up the data values in the appropriate
order:
Field AREA_CODE Text Length 3 Field SEVEN_DIGITS Text Length 7 Field EXTENSION Text Allow End_Spaces Length 4
|
|
Procedure
Considerations
A caveat to the dataset
restructuring lies with any compiled procedures that utilize the old definition
of the TELEPHONE attribute. These procedures are not going to work correctly,
due to the restructuring.
While the TELEPHONE
attribute name still exists, it is now a totally different data type (GROUP
instead of TEXT 14). This fact alone will frustrate the expectations of
compiled references to the attribute. Attempts to run a compiled procedure
on the new dataset expecting the old definition of TELEPHONE will likely
throw %S1032-E-BADTCREF errors, or similar, for the very reason that the
attribute structures are different between the two versions of the dataset.
For these procedures
to correctly operate upon the revised dataset, any references to the TELEPHONE
attribute must be updated to the new definition and the procedures and
libraries must be recompiled using the new dataset.