When fields are concatenated, the data types can change (the resulting
data type is automatically determined by the system). You can follow these
guidelines when double-byte character set (DBCS) fields are concatenated.
- The operating system assigns the data type based on the data
types of the fields that are being concatenated. When DBCS fields are included
in a concatenation, the general rules are:
- If the concatenation contains one or more hexadecimal (H) fields, the
resulting data type is hexadecimal (H).
- If all fields in the concatenation are DBCS-only (J), the resulting data
type is DBCS-only (J).
- If the concatenation contains one or more DBCS (O, E, J) fields, but no
hexadecimal (H) fields, the resulting data type is DBCS open (O).
- If the concatenation contains two or more DBCS open (O) fields, the resulting
data type is a variable-length DBCS open (O) field.
- If the concatenation contains one or more variable-length fields of any
data type, the resulting data type is variable length.
- A DBCS-graphic (G) field can be concatenated only to another DBCS-graphic
field. The resulting data type is DBCS-graphic (G).
- A UCS2-graphic (G) field can be concatenated to another UCS2-graphic field,
a UTF-8 character field, or a UTF-16 graphic field. The resulting data type
is UTF-16 if one of the operands is UTF-16, UTF-8 if one of the operands is
UTF-8 and no operands are UTF-16, and otherwise UCS-2.
- A UTF-8 character (A) field can be concatenated with another UTF-8 field,
a UTF-16 field, or a UCS-2 field. The resulting data type is UTF-16 if one
of the operands is UTF-16, UTF-8 if one of the operands is UTF-8 and no operands
are UTF-16, and otherwise UCS-2.
- A UTF-16 graphic (G) field can be concatenated with another UTF-16 field,
a UTF-8 field, or a UCS-2 field. The resulting data type is UTF-16 if one
of the operands is UTF-16, UTF-8 if one of the operands is UTF-8 and no operands
are UTF-16, and otherwise UCS-2.
- The maximum length of a concatenated field varies depending on the data
type of the concatenated field and length of the fields being concatenated.
If the concatenated field is zoned decimal (S), its total length cannot exceed
31 bytes. If the concatenated field is character (A), DBCS-open (O), or DBCS-only
(J), its total length cannot exceed 32,766 bytes (32,740 bytes if the field
is variable length).
The length of DBCS-graphic (G) fields is expressed
as the number of double-byte characters (the actual length is twice
the number of characters); therefore, the total length of the concatenated
field cannot exceed 16,383 characters (16,370 characters if the field is variable
length).
- In join logical files, the fields to be concatenated must be from the
same physical file. The first field specified on the CONCAT keyword identifies
which physical file is used. The first field must, therefore, be unique among
the physical files on which the logical file is based, or you must also specify
the JREF keyword to specify which physical file to use.
- The use of a concatenated field must be I (input only).
- REFSHIFT cannot be specified on a concatenated field that has been assigned
a data type of O or J.
Notes: - When bracketed-DBCS fields are concatenated, a shift-in at the end of
one field and a shift-out at the beginning of the next field are removed.
If the concatenation contains one or more hexadecimal fields, the shift-in
and shift-out pairs are only eliminated for DBCS fields that precede the first
hexadecimal field.
- A concatenated field that contains DBCS fields must be an input-only field.
- Resulting data types for concatenated DBCS fields might differ when using
The Open Query File (OPNQRYF) command.