Do not specify DDS keywords intended for use with numeric data for fields
containing DBCS data. The system treats DBCS data the same as character
data, and, therefore, cannot perform arithmetic operations on it.
For additional information on the keywords for database files, refer to the
keyword descriptions in Keywords for Physical and Logical Files to Create DDS Files.
Do not use the following DDS keywords with DBCS data fields (the data type
specified in position 35 is O, J, E, or G):
ABSVAL
ALTSEQ
CHECK(M10)
CHECK(M10F)
CHECK(M11)
CHECK(M11F)
CHECK(VN)
|
CHECK(VNE)
DATFMT
DATSEP
DIGIT
EDTCDE
EDTWRD
FLTPCN
|
REFSHIFT
SIGNED
SST
TIMFMT
TIMSEP
TRNTBL
ZONE
|
Notes:
- The SST keyword is allowed on fields with a data type of G.
- The REFSHIFT keyword is allowed on fields with a data type of O, J, or
E.
The CONCAT keyword can be used as described below.
Use this field-level keyword when you want to combine two or more fields
from the physical file record format into one field in the logical file record
format you are describing. The name of this concatenated field must
appear in positions 19 through 28. Specify the physical file field
names in the order in which you want them to be concatenated, and separate
them by blanks.
The following rules and restrictions apply:
- The OS/400 program assigns the length of the concatenated field as the sum
of the lengths (digits and characters) of the fields that are included in the
concatenation.
- Note:
- For fields with data type J, the shift-out and shift-in pairs between the
concatenated fields are removed from the resulting field. If the
resulting data type is hexadecimal, the shift-out and shift-in pairs are
eliminated for DBCS fields that precede the first hexadecimal fields.
- A DBCS-graphic field can be concatenated only with another graphic data
type field.
- The OS/400 program assigns the data type based on the data types of the
fields that are being concatenated. When bracketed-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 fields, the resulting data type is DBCS-open (O).
- The OS/400 program assigns the field to be fixed length or variable length
based on the fields that are being concatenated. The general rules
are:
- Concatenation of a variable length field to either a fixed length field or
another variable length field results in a variable length field.
- Concatenation of a fixed length field to a fixed length field results in a
fixed length field unless the VARLEN keyword is also specified on the same
field as the CONCAT keyword.
- The maximum length of a concatenated field varies depending on the data
type of the concatenated field and the length of the fields being
concatenated. If the concatenated field is zoned decimal (S), its total
length cannot exceed 31 bytes; if it is character (A) or DBCS(O, J), its
total length cannot exceed 32 766 bytes. If the concatenated field
is variable length, its total length cannot exceed 32 740 bytes
(32 739 if the field also allows the null value).
If the concatenated field is a DBCS-graphic (G) field, its total length
cannot exceed 16 383 characters. If the concatenated field is
variable length, its total length cannot exceed 16 370 characters.
- 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.
- When one or more of the fields being concatenated are DBCS fields, none of
the fields on the CONCAT keyword can be specified as a key, select, or omit
field unless the field name is also specified in positions 19 through 28 or on
a RENAME or CONCAT keyword specified before the DBCS concatenation.
- The usage 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.
Figure 449 shows how to specify the CONCAT keyword on the DDS coding
form.
Figure 449. Specifying the CONCAT Keyword for Database Files
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A R RECORD 1 PFILE(PF1)
A FLD1 I CONCAT(PFLD1 PFLD2)
A FLD2 I CONCAT(PFLD1 PFLD2 PFLD3)
A FLD3 I CONCAT(PFLD4 PFLD5)
A
In Figure 449, if the fields from PF1 are:
- PFLD1 with data type J
- PFLD2 with data type J
- PFLD3 with data type E
- PFLD4 and PFLD5 with data type G
Then the resulting fields are:
- FLD1 with data type J
- FLD2 with data type O
- FLD3 with data type G
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.