Dcompose - Composition of D-records from field instance unit representation

[ English | Japanese ]

[visit D-home]

SYNOPSIS

Dcompose [ options ] [ input-file.. ]

DESCRIPTION

Dcompose is the reverse operation of Ddecompose. It composes D-records from field instance unit representation, which has the D-field "fieldname" and the "value", into a D-field with the corresponding <field name> and <value>.

Input D-record should have three fixed name fields. Two fields "fieldname" and "value" are used to form a D-field. The third field "seq" controls composition of output D-record. Consecutive input D-records having same "seq" value are composed into one output D-record. This processs is similar to Dbundle with "seq" as the stem field. But, "seq" field is eliminated from the output of Dcompose.

The field order of "seq", "fieldname" and "value" in the input record does not matter. Other fields in the input records are just ignored, except for the fields listed in the -i option. which is described later.

The "seq" field' value is not necessaryly be real sequence value, nor acending or descending order. It is used just to group D-fields into an output D-record. When an input D-record lacks "seq" field, it is interpreted that the record has null value for the "seq" field.

The "fieldname" field's value in the input record should not have COLON (:). Dcompose does not check this. The user has responsibility to feed valid value in this field. When the "fieldname" field repeats, only the first value is used. When there is no "fieldname" field in the input D-record, the corresponding <field name> is null string.

When there is no "value" field in the input D-record, the corresponding <value> is null string. When the value" field repeats, only the first value is used.

Optionally, instead of "seq" field, you may give identifier field(s) with an -i option. In this case, unlike "seq" field, identifier fields are included in the output D-record as the top field(s).

Identifier fields or the "seq" field is compared as a key value. The comparison is affected by key flags, suppllied with -k option or with key-field-list. (See Key-field-list). The values of identifier fields in an output record is copied from the first input record of the same key value records.

OPTIONS

-i key-field-list
identification fields; these fields are copied to the composed D-record.
-k key-flags
default key-flags for the "seq" field and the key-field-list.
-D [i/o]datautf=8|16|32
UTF I/O feature (see manual page of UTF I/O feature.)

FIXED NAME FIELDS (INPUT)

seq:
gives record composition key.
fieldname:
gives <field name>.
value:
gives <value>.

ENVIRONMENT

Ddatautf, Didatautf, Dodatautf
for UTF I/O feature.

EXAMPLES

Typical usage of Dcompose is row-column transposition of a table. See the row-column transposition in the D_tutorial.

DIAGNOSTICS

See the manual of D_msg.

SEE ALSO

Dintro, D_msg, Ddecompose.

AUTHOR

MIYAZAWA Akira


miyazawa@nii.ac.jp
2011