The padding character, usually blank, should be an SBCS character for the character data type and a DBCS character for the DBCS data type.
Truncation may be required within programs by any operation that is associated with a data move operation. Special processing is necessary to maintain the validity of the resulting string; i.e. a character string should not be truncated between the first byte and the second byte of a DBCS character.
The following figures are examples of the adjustment for the character data type
SOURCE DATA RIGHT SIDE ADJUSTMENT RESULTS TRUNCATED HERE | | | V V eDiDjDke eDiDjDke eDiDjDke eDiDjDk eDiDjDke eDiDjp eDiDjDke eDiDj eDiDjDke eDip eDiDjDke eDi eDiDjDke ep Note: The character 'p' depicts the padding character. Example of Truncation - RIGHT SIDE ADJUSTMENT
SOURCE DATA LEFT SIDE ADJUSTMENT RESULTS TRUNCATED HERE | | | V V eDiDjDke e eDiDjDke pe eDiDjDke Dke eDiDjDke pDke eDiDjDke DjDke eDiDjDke pDjDke eDiDjDke DiDjDke Note: The character 'p' depicts the padding character. Example of Truncation - LEFT SIDE ADJUSTMENT
As for the DBCS data type, any truncation that results in an odd byte length string should be either prohibited or adjusted to result an even byte length string (usually discarding the fragment byte).
A substring operation can be considered as a combination of two truncation operations, left side and right side.See Truncation part, too.
In an assignment operation, truncation or padding may be required. See Truncation and Padding part.